home *** CD-ROM | disk | FTP | other *** search
/ LSD Docs / LSD Docs.iso / FILEZ / lsd30.dms / lsd30.adf / cando2.doc.pp / cando2.doc
Text File  |  1978-11-19  |  108KB  |  3,072 lines

  1.             part 2 of cando manual
  2.  
  3.  
  4. SYSTEM VARIABLES
  5.  
  6.     System Variable can be used in expressions as variables. Some of
  7. these variables return dynamic information that is updated by CanDo. Others
  8. have static values for common uses:
  9.  
  10.     Boolean Values:
  11.  
  12.     «logical» = FALSE    - Boolean Value (FALSE).
  13.  
  14.     «logical» = TRUE    - Boolean Value (TRUE).
  15.  
  16.     «logical» = NO    - Boolean Value (FALSE).
  17.  
  18.     «logical» = YES    - Boolean Value (TRUE).
  19.  
  20.     «logical» = OFF    - Boolean Value (FALSE).
  21.  
  22.     «logical» = ON    - Boolean Value (TRUE).
  23.  
  24.     Informational:
  25.  
  26.     <integer> = AvailableChipMemory    - available bytes in chip memory.
  27.  
  28.     <integer> = AvailableFastMemory    - available bytes in fast memory.
  29.  
  30.     <integer> = AvailableMemory    - available bytes in memory.
  31.  
  32.     <integer> = LargestChunkOfMemory    - the largest continuous chunk of
  33.                       available memory.
  34.  
  35.     "string" = DeckName    - the name of the current Application.
  36.  
  37.     "string" = CardName    - the name of the current Card.
  38.  
  39.     "string" = ObjectName    - the name of the current running Object.
  40.  
  41.     <integer> = MaxInteger    - returns  2.147.483.647.
  42.  
  43.     <integer> = MinInteger    - returns -2.147.483.647.
  44.  
  45.     «logical» = Supervised    - TRUE when running from CanDo.
  46.  
  47.     "string" = TheTime    - returns the current time - "HH MM SS".
  48.  
  49.     "string" = TheDate    - returns the current date - "YY MM DD".
  50.  
  51.     CanDo has a number of System variables that are closely related with
  52. a group of Commands. These System variables are documented in the sections
  53. with these Commands.
  54.  
  55.                                      6-17
  56.  
  57.                             Flow Control Commands
  58.  
  59.     The Flow Control commands allow you to change the order of execution
  60. within a script. Usually, commands execute one at a time from top to bottom.
  61. These Commands effect this flow of execution.
  62.  
  63. If... Endif
  64.  
  65.     The If Command allows you to execute a group of instructions when a
  66. certain condition is TRUE (see Logical Expression).
  67.  
  68. If { logical expression }
  69.     ...Commands...
  70.  
  71. Endif
  72.  
  73.     The commands between the If command and the Endif command are
  74. performed only when the logical expression is true.
  75.  
  76. Example:
  77.     If NumberOfHits > 10
  78.         ShowBrush "Brushes:Explode.br"
  79.         PlaySound "sounds:bang.snd"
  80.     Endif
  81.  
  82.  
  83. If... Else... Endif
  84.  
  85.     The Else Command can be used with an If to perform an alternate set
  86. of commands when the logical expresson is false.
  87.  
  88. Example:
  89.     If NumberOfHits > 10
  90.         ShowBrush "Brushes:Explode.br"
  91.         PlaySound "sounds:bang.snd"
  92.         Let NumberOfHits = 0
  93.     Else
  94.         PlaySound "sounds:Doink.snd"
  95.         Let NumberOfHits = NumberOfHits + 1
  96.     Endif
  97.  
  98.     The commands between the If and the Else are performed when the value
  99. of NumberOfHits is greater then 10. Otherwise, the Commands between the Else
  100. and the Endif are performed.
  101.     CanDo supports four looping combinations. These Commands allow you to
  102. repeat a group of commands given specified conditions.
  103.  
  104.                                      6-18
  105.  
  106. While... EndLoop
  107.  
  108.     CanDo supports four looping combinations. The While Command allows
  109. you to repeat a group of Commands while a condition is TRUE. The form for a
  110. While Command is:
  111.  
  112.     While { logical expression }
  113.         ...Commands...
  114.     EndLoop
  115.  
  116.     The Commands between the While and EndLoop are performed while the
  117. logical expression is TRUE. When the While instruction is encountered, the
  118. logical expression is evaluated. If the condition is TRUE, the Commands
  119. between the While and the EndLoop are performed. When the EndLoop Command is
  120. encountered, execution is looped back to the While Command. This continues
  121. until the logical expression is FALSE.
  122.     When the logical is FALSE, all Commands between the While and EndLoop
  123. are skipped, are execution continues on the instruction following the EndLoop.
  124.  
  125. Example:
  126.     Let Xoffset = 20
  127.     While Xoffset <= 300
  128.         ShowBrush "Brushes:Arrow.br",Xoffset,40
  129.         Let Xoffset = Xoffset + 20
  130.     EndLoop
  131.  
  132.  
  133. Loop... Until
  134.  
  135.     The typical format for the Until Looping Command is shown below.
  136.  
  137.     Loop
  138.         ...Commands...
  139.     Until { logical expression }
  140.  
  141.     The Until works in a similar manner as the While Loop. The commands
  142. between the Loop and Until are performed until the logical expression is TRUE.
  143. The Until Loop is used when you want the Commands in the Loop to be performed
  144. once before evaluatine the logical expression.
  145.  
  146. Example:
  147.     Let Xoffset = 20
  148.     Loop
  149.         ShowBrush "Brushes:Arrow.br",Xoffset,40
  150.         Let Xoffset = Xoffset + 20
  151.     Until Xoffset > 300
  152.  
  153.                                      6-19
  154.  
  155. While... Until
  156.  
  157.     This Looping combination, while unusual, is valid. The format for the
  158. While and Until Looping Commands is shown below.
  159.  
  160.     While { logical expression }
  161.         ...Commands...
  162.     Until { logical expression }
  163.  
  164.     The Commands between the While and Until are performed as long as the
  165. While's logical expression is TRUE and the Until's logical expression is
  166. FALSE.
  167.  
  168.  
  169. Loop... EndLoop
  170.  
  171.     The form of Loop and EndLoop Commands is shown belov.
  172.  
  173.     Loop
  174.         ...Commands...
  175.     EndLoop
  176.  
  177.     This is a simple looping system. All commands within the looped area
  178. are repeated until an 'ExitLoop' command is executed. You should be very
  179. careful insuring there is a way for the ExitLoop to be performed. It is
  180. usually within an If... Endif placed in the Loop commands.
  181.  
  182.  
  183. ExitLoop
  184.  
  185.     Exits the Highest Loop Level. This command is usually within an If...
  186. Endif in the Loop commands. It can be used to exit any of the Loop
  187. combinations. If you have nested Loops ( Loops within Loops ) it exits the
  188. hightest Loop level.
  189.     Note: Your Scripts will be more readable if you use the While and
  190. Until conditional Looping instead of ExitLoop.
  191.  
  192.                                      6-20
  193.  
  194. Do "Routine Name" {, Argument1... , Argument10 }
  195.  
  196.     The Do Command performs the routine created using the Routine Object.
  197. The "routine name" must match the Name used in the ROUTINE EDITOR REQUESTER.
  198. This is very similar to the Gosub used in other languages. The Commands within
  199. the routine will be performed, and execution will continue with the Command
  200. following the Do.
  201.     You can use the ROUTINE EDITOR TOOL for finding the available routine
  202. names.
  203.  
  204.     Example:
  205.         If value = 5
  206.             Do "ShowExplosions"
  207.             Do "SoundEffects"
  208.         Endif
  209.  
  210.     Optionally, you can pass a routine up to 10 arguments. An argument is
  211. simply a value that the calling script gives the routine.
  212.  
  213.     Do "Draw Box",2,10,20
  214.  
  215.     This example calls the Routine "Draw Box" and passes it three
  216. arguments: 2,10, and 20. While this example uses constants, each argument can
  217. be an expression.
  218.     The routine "Draw Box" can use the arguments to perform its task. It
  219. does this using the System Variables Arg1 through Arg 10.
  220.  
  221.     SetPen Arg1
  222.     DrawRectangle Arg2,Arg3,50,25
  223.  
  224.     If the routine "Draw Box" contained this script, it could use three
  225. arguments to draw a box. Arg1 is used with the SetPen Command to set PanA. The
  226. previous example passed a value of 2 for the fist argument. This would result
  227. in setting PenA to color 2. The DrawRectangle Commands draws a box with a
  228. width of 50 and a height of 25. Its origin would be determined by the second
  229. and third arguments. Using the previous example, this would draw the box at
  230. 10,20.
  231.  
  232.                                      6-21
  233.  
  234. ExitScript
  235.  
  236.     A Script usually exits after performing the last Command. An
  237. ExitScript exits as though the last Command was performed. If the ExitScript
  238. is performed from a Routine, execution will continue in the calling Script.
  239.  
  240.  
  241. StopScript
  242.  
  243.     The StopScript command is similar to an ExitScript. However, if it is
  244. performed from a Routine, execution will not continue in the calling Script.
  245. It does not run your application, it simply terminates the execution of the
  246. current Script, and any scripts that may have called it using a Do Command.
  247.  
  248.  
  249. Quit
  250.  
  251.     This Command allows the user to exit the presently running Deck.
  252. While you are developing you application, CanDo will not allow you to exit
  253. using a Quit Command. However, when you run it as a separate application, it
  254. is important to provide a way to Quit.
  255.  
  256.                                      6-22
  257.  
  258.                             Card Movement Commands
  259.  
  260.     These Commands change Cards in the Deck. They correspond to the Card
  261. Movement Buttons on the MAIN CONTROL PANEL.
  262.  
  263. NextCard
  264.  
  265.     NextCard goes to the next Card in the Deck. If you are currently on
  266. the last Card in the Deck, It will go to the first Deck.
  267.  
  268. PreviousCard
  269.  
  270.     PreviousCard goes to the provious Card in the Deck. If you are on the
  271. first Card, it will go to the last Card.
  272.  
  273. FirstCard
  274.  
  275.     FirstCard goes to the first Card in the Deck.
  276.  
  277. LastCard
  278.  
  279.     LastCard goes to the last Card in the Deck.
  280.  
  281. GotoCard
  282.  
  283.     GotoCard "cardname"
  284.  
  285.     You can use a Card's Name to move directly to a specific Card with
  286. the GotoCard Command. The name must be spelled exactly as it was spelled in
  287. the CARD EDITOR REQUESTER. The "cardname" is a string parameter.
  288.  
  289.     Example:
  290.         GotoCard "Card #2"
  291.  
  292.                                      6-23
  293.  
  294.                                Graphic Commands
  295.  
  296.     The Graphic Cammands change the images in your Card's Window. This
  297. can be done by showing pictures and brushes, by drawing images or displaying
  298. Text. In addition, there are variety of commands that control how other
  299. drawing commands are performed.
  300.  
  301. Picture and Brush Commands
  302.  
  303.     CanDo's Picture and Brush Commands allow you to show images created
  304. with any Paint Program. These commands include "Clipping" allowing you to copy
  305. images from your window. These clipping images can then be displayed or saved
  306. to a file.
  307.  
  308.  
  309. LoadPicture "filename" {, "name" {, loadflags } }
  310.  
  311.     Before an image can be displayed, it must be loaded into memory. This
  312. can be done automatically with the ShowPicture Command. However, there will be
  313. a delay as the image is loaded. This may be OK most of the time. However, it
  314. can be avoided by pre-loading the image using the LoadPicture Command. The
  315. LoadFlags are described in the LoadFlags Appendix.
  316.  
  317.     "Filename"
  318.  
  319.     The "FileName" is the file specification for the image being loaded.
  320. It must be a valid ILBM file type created by most Amiga Paint programs.
  321.  
  322.     "Name"
  323.  
  324.     The optional "Name" allows you to specify the name used by a
  325. ShowPicture Command. When the "Name" is not specified, the ShowPicture Command
  326. must use the exact same string used in the "filename".
  327.  
  328.     Example:
  329.         LoadPicture "images:backgrouned.pic","background"
  330.         ShowPicture "background"
  331.  
  332.  
  333. LoadBrush "filename" {, "name" {, loadflags } }
  334.  
  335.     The LoadBrush Command works simiarly to the LoadPicture Command,
  336. except is pre-loads a brush file created by a paint program. It can then be
  337. shown using the ShowBrush Command. The parameter are identical to
  338. LoadPicture's parameters.
  339.  
  340.     Example:
  341.         LoadBrush "brushes:theleftarrow.br","LeftArrow"
  342.         ShowBrush "LeftArrow",10,190
  343.  
  344.                                      6-24
  345.  
  346. ShowPicture "Picture Name"
  347.  
  348.     The ShowPicture Command is used to change the picture being
  349. displayed. CanDo automatically adjusts the screen resolution and color
  350. palette. Furthermore, Visible Objects are re-displayed on the new picture.
  351.     You should be careful when using pictures of different dimensions.
  352. Objects, such as Buttons, are displayed at specified Horizontal and Vertical
  353. locations. For Example: If the original window had a width of 640 and a
  354. picture having a width of 320. The safest approach is to use different cards
  355. with pictures having different dimensions.
  356.  
  357. "Picture Name"
  358.  
  359.     The "Picture Name" indicates the file to be displayed. The name can
  360. be a file specification. If so, CanDo will automatically load it if is is not
  361. already in memory. It can also be a "Name" specified in a LoadPicture Command.
  362.  
  363.     Examples:
  364.         ShowPicture "images:BigBird.pic"
  365.  
  366.         LoadPicture "images:Background.pic","TheBackground"
  367.         ShowPicture "TheBackground"
  368.  
  369.  
  370. ShowBrush "Brush Name" , < X > , < Y > {, BRUSHPALETTE }
  371.  
  372.     This command shows a DPaint style brush at a specified location on
  373. the current window. Optionally, you can use the color palette saved with the
  374. brush. You will have more predictable result if the Brush uses the same
  375. resolution as the current picture.
  376.     BRUSHPALETTE indicates to use the palette saved with the brush.
  377.  
  378.     Examples:
  379.         ShowBrush "brushes:Bat.br",500,25
  380.  
  381.         LoadBrush "brushes:helloworld.br","theimage"
  382.         ShowBrush "theimage",50,50,BRUSHPALETTE
  383.  
  384.                                      6-25
  385.  
  386. SavePicture "Picture Name" {, "Filename" }
  387.  
  388.     The SavePicture Command lets you save a picture. The picture can be
  389. one that was loaded or created using the ClipPicture Command. It can either
  390. save it in the original file or create a new one. The "Picture Name" indicates
  391. the picture to save. The optional "filename" allows you to explicitly indicate
  392. the filename to use. If the "filename" is not speicfied, CanDo will either
  393. save the file using the original filename, or use the "Picture Name" as the
  394. file specification if it was created using the ClipPicture Command.
  395.  
  396.  
  397. SaveBrush "Brush Name" {, "Filename" }
  398.  
  399.     The SaveBrush Command allows you to save a brush. This command works
  400. similarly to the SavePicture Command, except the image is saved in the Brush
  401. format. The parameters work the same way as the SavePicture Command
  402. parameters.
  403.  
  404.  
  405. ShowPalette "Name"
  406.  
  407.     This command changes the palette to the one saved with a picture or
  408. brush. The "Name" is either the file specification or the name used with the
  409. LoadPicture or LoadBrush Commands. If the image is not currently in memory,
  410. the ShowPalette Commands will use the "Name" as a file specification from
  411. which to read the palette from a file.
  412.  
  413.                                      6-27
  414.  
  415. Transparent «logical expression»
  416.  
  417.     When a brush is saved, the background color is called Transparent.
  418. This means instead of seeing the color, you can "see through" it. CanDo allows
  419. you to turn this ON or OFF before showing a brush.
  420.     The «logical expression» indicates whether to turn transparency on or
  421. off. When the expression is TRUE (or ON) you will be able to see through the
  422. transparent color. Otherwise, the background color will be shown. Most of the
  423. time you will to use the constats ON or OFF.
  424.  
  425.     Examples:
  426.         Transparent ON
  427.         ShowBrush "brushes:Arrow.br",20,30
  428.  
  429.         Transparent OFF
  430.         ShowBrush "brushes:Dog.br",120,40
  431.  
  432.  
  433. ClipPicture "Picture Name" {, CHIP }
  434.  
  435.     ClipPicture allows you to make a copy of the current card's window.
  436. The "Picture Name" names the image so you can use it later in a ShowPicture or
  437. SavePicture Command. If the "Name" is currently being used, it will be
  438. replaced with the clipped picture. The CHIP keyword indicates to save the
  439. image in the Amiga's Chip memory.
  440.  
  441.  
  442. ClipBrush < X > , < Y > , < Width > , < Height > , "Brush Name" { ,CHIP }
  443.  
  444.     ClipBrush lets you grab a portion of the current card's window and
  445. use it as a brush. The <X> and <Y> indicates the Origin, the location of the
  446. upper left corner, of the area to be clipped. The <Width> and <Height>
  447. indicates the number of pixels horizontally and vertically, from the Origin,
  448. to clip. The "Brush Name" gives it a name so you can use it in a ShowBrush or
  449. SaveBrush Command. If the "Brush Name" currently is being used, it will be
  450. replaced with the clipped brush. The CHIP keyword indicates to save the brush
  451. in the Amiga's Chip memory.
  452.  
  453. SetClipTransparentColor < color >
  454.  
  455.     The SetClipTransparentColor Command sets the background color used in
  456. a clipped brush. This color is transparent in a ShowBrush Command when
  457. Transparent is ON.
  458.  
  459.                                      6-26
  460.  
  461. Draw Commands
  462.  
  463.     CanDo uses the Amiga Operation System supplied graphics routines.
  464. They do not make color corrections for HAM. This means you may see some
  465. "jaggies" when drawing in HAM mode. This can be minimized or eliminated by
  466. only drawing on portions of the picture that use the 16 primary colors.
  467. (AmigaWorld's March 1989 issue has a good description of HAM).
  468.  
  469.  
  470. AreaCircle < X > , < Y > , < R >
  471.  
  472.     Draws a filled circle with a center of <X>,<Y> and a radius of <R>.
  473. The circle is filled with the color i PenA. The aspect ratio si not corrected
  474. for High-Resolution Screens.
  475.  
  476.     Example:
  477.         AreaCircle 50,50,25
  478.  
  479.  
  480. AreaEllipse < X > , < Y > , < XR > , < YR >
  481.  
  482.     Draw a filled ellipse with a center at <X>,<Y>. The horizontal radius
  483. of the ellipse is <XR> and the vertical radius is <YR>. The ellipse is filled
  484. with the color in PenA.
  485.  
  486.     Example:
  487.         AreaEllipse 50,05,25,50
  488.  
  489.  
  490. AreaRectangle < X > , < Y > , < W > , < H >
  491.  
  492.     Draws a filled rectangle with an upper left coordinate at <X>,<Y>.
  493. The width of the rectangle is <W> and the height is <H>. The rectangle is
  494. filled with the color in PenA.
  495.  
  496.     Examples:
  497.         AreaRectangle 50,50,100,100
  498.         AreaRectangle 52,52,96,96
  499.  
  500.  
  501. FloodFill < X > , < Y >
  502.  
  503.     The FloodFill Command fills a solid shape starting at <X>,<Y>. If
  504. will fill using the color in PenA. The shape is determined by the color at
  505. location <X>,<Y>.
  506.  
  507.     Example:
  508.         SetPen 7
  509.         FlooFill 50,50
  510.  
  511.                                      6-28
  512.  
  513. FillToBorder < X > , < Y > , < BorderColor >
  514.  
  515.     The FillToBorder fills a shape starting at <X>,<Y> and is outined in
  516. the color specified be the <BorderColor>. Like FloodFill, it will fill using
  517. the color in PenA.
  518.  
  519.     Example:
  520.         SetPen 3
  521.         DrawRectangle 10,10,100,100
  522.         SetPen 1
  523.         FillToBorder 20,20,3
  524.  
  525.  
  526. DrawCircle < X > , < Y > , < R >
  527.  
  528.     Draw a circle with a center of <X>,<Y> and a radius of <R>. The
  529. aspect ratio is not corrected for High-Resolution Screens.
  530.  
  531.  
  532. DrawEllipse < X > , < Y > , < XR > , < YR >
  533.  
  534.     Draws an ellipse with a center of <X>,<Y>. The horizontal radius of
  535. the ellipse is <XR> and it's vertical radius if <YR>.
  536.  
  537.     Example:
  538.         DrawEllipse 50,50,25,50
  539.  
  540.  
  541. DrawLine < X1 > , < Y1 > , < X2 > , < Y2 >
  542.  
  543.     This command will draw a line from <X1>,<Y1> to <X2>,<Y2>. The
  544. current pen position will be set to <X2>,<Y2>.
  545.  
  546.     Examples:
  547.         DrawLine 50,50,100,50
  548.  
  549.         DrawLine 50,52,100,52
  550.  
  551.  
  552. DrawPixel < X > , < Y >
  553.  
  554.     Draws a single pixel at a certain location. This command uses the
  555. present drawmode and will set the current pen position to that of the pixel
  556. drawn.
  557.  
  558.     Parameters:
  559.  
  560.     < X >    The Number pixels from the window right hand border.
  561.  
  562.     < Y >    The Number pixels from the window top border.
  563.  
  564.                                      6-29
  565.  
  566. DrawRectangle < X > , < Y > , < W > , < H >
  567.  
  568.     Draw arectangle with an upper left coordinate of <X>,<Y>. The width
  569. of the rectangle is <W> and the height is <H>. No aspect ratio computations
  570. are computed. The current pen positoin is set to the <X>,<Y> of the rectangle.
  571.  
  572.     Examples:
  573.         DrawRectangle 50,50,100,100
  574.  
  575.         DrawRectangle 52,52,96,96
  576.  
  577.  
  578. DrawTo < X > , < Y >
  579.  
  580.     This command is similar to the line Command. However, it uses the
  581. current pen position for the starting point for the line. It draws a line from
  582. the current pen position to the specified window coordinate. After drawing the
  583. line, the pen positon will be set to the specified window coordinates.
  584.  
  585.     Example:
  586.         Line 50,05,100,50
  587.         DrawTo 100,100
  588.  
  589.  
  590. MovePen < X > , < Y >
  591.  
  592.     Moves the pen to the specified window coordinate. This command does
  593. not draw any points in window.
  594.  
  595.     Example:
  596.         MovePen 50,50
  597.  
  598.  
  599. RayTo < X > , < Y >
  600.  
  601.     This is similar to the DrawTo Command. With this command a line is
  602. drawn from the current pen position to the specified window coordinate.
  603. However, the current pen position is not modified.
  604.  
  605.     Example:
  606.         Let XPos=60
  607.         MovePen 160,100
  608.         While XPos <=260
  609.             RayTo XPos,10
  610.             Let XPos=XPos+40
  611.         EndLoop
  612.  
  613.                                      6-30
  614.  
  615. ClearWindow { <color> }
  616.  
  617.     The ClearWindow Command clears the window to its inital state. This
  618. means it will redisplay the image if it is a Picture Window. If it is not a
  619. Picture Window, it will clear the window to the color specified in the Window
  620. Color Requester or to the optional <color>. In either case, all visible
  621. objects will be redisplayed.
  622.  
  623.     Examples:
  624.         ClearWindow
  625.  
  626.         ClearWindow 5
  627.  
  628.  
  629. Graphics Control
  630.  
  631.     The Graphics Control Commands change various values that effect the
  632. other Graphic Commands.
  633.  
  634.  
  635. GetRGB < col.reg. > , < red var. > , < green var. > , < blue var. >
  636.  
  637.     Gets the RGB values from a specified color register. The RGB values
  638. range from 0 to 255. Remember that different view mode use the color registers
  639. very differently.
  640.  
  641.     < col.reg. >    The color register to read.
  642.     < red var. >    Variable for the red part of the register.
  643.     < green var. >    Variable for the green part of the register.
  644.     < blue var. >    Variable for the blue part of the register.
  645.  
  646.     Example:
  647.         GetRGB 1,RedValue,GreenValue,BlueValue
  648.  
  649.  
  650. SetAreaDrawMode NORMAL or OUTLINE
  651.  
  652.     The SetAreaDrawMode Command only effects the Area Commands:
  653. AreaCircle, AreaEllips, and AreaRectangle. The default mode is NORMAL. When it
  654. is NORMAL, the area is drawn in a solid color using PenA. When it is OUTLINE,
  655. the Area is drawn using PenA outlined with the color in PenO. When this draw
  656. mode is set, all subsiquent Area Commands will use the specified mode.
  657.  
  658.  
  659. SetDrawMode { Normal } { Jam1 } { Jam2 } { Complement } { InverseVideo }
  660.  
  661.     This command allows the user to specify the drawing style they wish
  662. to use. The keywords can be used with one another (i.e. SetDrawMode Normal
  663. InverseVideo).
  664.  
  665. { Normal }    Draw with the primary pen.
  666. { Jam 1 }    Same as the Normal switch.
  667. { Jam 2 }    Draw with both primary and secondary pen.
  668. { Complement }    Performs a logical XOR on the pixel's own color info.
  669. { InverseVideo }    Performs a logical NOT on the other draw modes.
  670.  
  671.                                      6-31
  672.  
  673. SetPen < PenA > {, < PenB > {, < PenO > } }
  674.  
  675.     Set the primary, secondary and outline pen's color register. This
  676. command allows the user to specify which color to draw with. The PenB and PenO
  677. are optional
  678.  
  679.     < PenA >    The color register for the primary drawing pen.
  680.     < PenB >    The color register for the secondary drawing pen.
  681.     < PenO >    The color register for the area outline pen.
  682.  
  683.     Example:
  684.         SetPen 1
  685.         DrawPixel 10,14
  686.  
  687.  
  688. SetRGB < col.reg. > , < red > , < green > , < blue >
  689.  
  690.     Set the RGB values for the specified color register. The RGB values
  691. range from 0 to 255. Remember that different view modes use the color
  692. registers very defferently.
  693.  
  694.     < col.reg. >    The color register to read.
  695.     < red >        Variable for the red part of the register.
  696.     < green >    Variable for the green part of the register.
  697.     < blue >     Variable for the blue part of the register.
  698.  
  699.     Example:
  700.         SetRGB 3,RedValue,GreenValue,BlueValue
  701.  
  702.  
  703. CycleColors < From-Color >, < To-Color > {, FORWARD or BACKWARD }
  704.  
  705.     The CycleColors Command cycles the current color palette. The
  706. < From-Color > < To-Color > indicates the range. It does not make any
  707. difference if the < From-Color > is less than the < To-Color >.
  708.     The CycleColors Command rotates the colors once from the lower to the
  709. highter. The optional keywords FORWARD and BACKWARD specify the direction of
  710. the rotation. If neither is specified, it defaults to FORWARD. FORWARD
  711. indicates lower values are torated upward. BACKWARD indicates the higher
  712. values are rotated downward.
  713.     The CycleColors Command can be placed in a reoccurring Timer Object
  714. to provide continuous cycling.
  715.  
  716.  
  717.     Example:
  718.         CycleColors 5,10,FORWARD
  719.  
  720.     Reg. 0 1 2 3 4 5 -> 6 -> 7 -> 8 -> 9 -> 10 11 12 13 14 15 16
  721.               ^                 v
  722.               ^                 v
  723.                <- <- <- <- <- <- <- <- <-
  724.  
  725.                                      6-32
  726.  
  727. Print Commands
  728.  
  729.     The Print Commands allow you to print text messages to the window.
  730. You can use various fonts, sizes, colors, and enhanced print styles.
  731.  
  732.  
  733. PrintText < X > , < Y > , "string"
  734.  
  735.     Prints the "string" using the current pen colors, print style, and
  736. font. The x,y coordinate specifies the upper left corner of the text string.
  737.  
  738.     Example:
  739.         PrintText 50,50,"Hello World"
  740.  
  741.  
  742. SetPrintStyle StandardFlags { ExtendedFlags } {, < ExtPen1 > {, ExtPen2 > } }
  743.  
  744.     The SetPrintStyle Command specifies the style of print for subsequent
  745. PrintText Commands. The StandardFlags are PLAIN, ITALIC, BOLD, and UNDERLINED.
  746. You can specify one of more of these. Optional, you can specify one of the
  747. ExtendedFlags: SHADOW, OUTLINE, GHOSTED, or EMBOSSED. Make sure you do not
  748. seperate any of the flags with commas.
  749.     The Extended Pens, < ExtPen1 > and < ExtPen2 >, are used with the
  750. Extended styles. The PrintText command uses the color in PenA as the primary
  751. color for drawing the text. When using an Extended style, the < ExtPen1 > is
  752. used as a secondary color. The EMBOSSED style uses the additional color
  753. < ExtPen2 >.
  754.  
  755.     Example:
  756.         SetPen 1
  757.         SetPrintStyle BOLD ITALIC
  758.         PrintText "This uses a single color. It is BOLD and
  759.               Italic.",20,20
  760.  
  761.         SetPen 0
  762.         SetPrintStyle GHOSTED,5
  763.         PrintText "The Primary Color is 0 GHOSTED in 5.",20,80
  764.  
  765.         SetPen 3
  766.         SetPrintStyle BOLD EMBOSSED,1,2
  767.         PrintText "The Center is Pen 3, with Color 1 and 2 on each
  768.               side.",20,120
  769.  
  770.  
  771. SetPrintFont "FontName" , < PointSize >
  772.  
  773.     Set the print font for the PrintText Command. If the operation system
  774. connot find the point size you are looking for, it will give you the next
  775. smallest size available. If the operation system cannot find the font you are
  776. looking for, it will give you the font Topaz 80.
  777.  
  778.     Example:
  779.         SetPrintFont "Topaz",9
  780.         PrintText "Hello World",50,50
  781.  
  782.                                      6-33
  783.  
  784. GetTextDimensions "Text" , Width-Variable , Height-Variable
  785.  
  786.     This command sets the contents of two variables to the width and
  787. height of the indicated "Text" string. It evaluates the "Text" using the
  788. current font, point size, and print style. The Width-Variable and
  789. Height-Variable must be valid variable names. The variables will be set to the
  790. corresponding values.
  791.  
  792.     Example:
  793.         GetTextDimensions "Hello" , Hello Width , Hello Height
  794.  
  795.  
  796. Functions
  797.  
  798.     This Function can be used in expressions to return informaton
  799. relating to Graphics Commands.
  800.  
  801.  
  802. ColorOfPixel
  803.  
  804.     <integer> = ColorOfPixel ( <X>,<Y> ) -This is the Color of the Pixel
  805.                       at the specified x,y location.
  806.  
  807.  
  808. System Variables
  809.  
  810.     <integer> = PenA    -This is the Color Register for PenA.
  811.  
  812.     <integer> = PenB    -This is the Color Register for PenB.
  813.  
  814.     <integer> = PenO    -This is the Color Register for PenO.
  815.  
  816.     <integer> = ClipTransparentColor    - This function returns the
  817.                       background color used when
  818.                       clipping brushes.
  819.  
  820.     «logical» = TransparentStatus    - This function returns TRUE if
  821.                       Transparent is enabled, and
  822.                       FALSE if not.
  823.  
  824.                                      6-34
  825.  
  826.                           Screen and Window Commands
  827.  
  828.     The WINDOW OBJECT EDITOR allows you to define the Window when it
  829. opens. The Window will open on either the Workbench, or a Custom Screen. If
  830. you are not familiar with the way the Amiga works, the differences between a
  831. Window and a Screen can be a little confusing. The Screen is the full-width
  832. area of the display which defines the display mode, resolution, and color
  833. palette. A Window is displayed on a Screen and can be its full size or
  834. smaller.
  835.     These Commands allow you to change the position and attributes of
  836. both the Screen and Window.
  837.  
  838.  
  839. MoveScreen < Delta - X > , < Delta - Y >
  840.  
  841.     The MoveScreen Command moves the screen a specified number of pixels
  842. right or left, < Delta - X >, or up or down < Delta - Y >. Note that under
  843. Amiga operation systems 1.3 and before, it is not possible to move a screen
  844. borizontally. The delta integers make it easy to move the screen specific
  845. distances without reference to its current position.
  846.  
  847.     Examples:
  848.         MoveScreen 0,-10
  849.             This would move the screen up 10 pixels.
  850.  
  851.         MoveScreen 0,10-ScreenY
  852.             This example would move the screen to be 10 pixels
  853. from the top. Because ScreenY indicates the current position. 10-ScreenY will
  854. always positon it 10 pixels from the top.
  855.  
  856.  
  857. ScreenTo FRONT or BACK
  858.  
  859.     The ScreenTo Command moves the screen either to the back of the
  860. displayes screens or to the front of the displayed screens.
  861.  
  862.     Examples:
  863.         ScreenTo BACK
  864.  
  865.         ScreenTo FRONT
  866.  
  867.  
  868. ScreenTitleBar «logical expression»
  869.  
  870.     This command makes the screen (if it is your own, custom screen, and
  871. not Workbench's screen) have a visible title bar. By using this command and
  872. eliminating your window's title, and border, and all of your window's standard
  873. objects (dragbar, closebutton, e.t.c.), you can use the screen's dragbar to
  874. move the screen up and down with the mouse.
  875.  
  876.  
  877. SetScreenTitle "Text"
  878.  
  879.     This sets the title of the screen to be the indicated text when your
  880. window is the active window. If you have created a Workbench window, when your
  881. window is inactive, the screen title bar will reflect some other name
  882. (probably Workbench), and when your window is active the screen will show the
  883. title set with this command.
  884.  
  885.                                      6-35
  886.  
  887. MoveWindow < Delta - X > , < Delta - Y >
  888.  
  889.     The MoveWindow Command moves the window a specified number of pixels
  890. right or left, < Delta - X >, or up or down < Delta - Y >. The delta integers
  891. make it easy to move the window specific distances without refeence to its
  892. current position.
  893.  
  894.  
  895. WindowTo FRONT or BACK
  896.  
  897.     The WindowTo Command moves the window either to the back of the
  898. displayed windows or to the front of the displayed window. Because a Custom
  899. Screen has only one Window, this command is only useful on a Workbench Window.
  900. If the window was created in Backdrop mode (see Window Options), it cannot be
  901. moved in front ot other windows.
  902.  
  903.  
  904. SetWindowTitle "Text"
  905.  
  906.     The WindowTo Command sets the title of your window to the indicated
  907. text. If you have previously removed all of the standard window objects,
  908. border, and title, this will only add a bar to the top of your window in which
  909. the title will be displayed. The Initial Window Title is set on the WINDOW
  910. EDITOR REQUESTER.
  911.  
  912. SetWindowLimits < MinX > , < MinY > , < MaxX > , < MaxY >
  913.  
  914.     The SetWindowLimits Command controls the minimum and maximum size of
  915. your window. With these limitations in place, your window cannot be resized by
  916. the user to any dimensions outside of these ranges. It is often convenient to
  917. use this command in the AfterStartUp Script of your card. In this way,
  918. immediately after Window Object has been opened, you can set the limitations
  919. on its sizw before the user has had a chance to resize you window.
  920.  
  921.                                      6-36
  922.  
  923. Current Screen and Window Information
  924.  
  925.     <integer> = MouseX    - Horizontal position of the mouse.
  926.  
  927.     <integer> = MouseY    - Vertical position of the mouse.
  928.  
  929.     <integer> = WindowColors    - Number of Colors.
  930.  
  931.     <integer> = WindowHeight    - Height of the Window.
  932.  
  933.     <integer> = WindowWidth    - Width of the Window.
  934.  
  935.     "string"  = WindowTitle    - Text in Window Title Bar.
  936.  
  937.     <integer> = WindowX    - Horizontal offset of the window.
  938.  
  939.     <integer> = WindowY    - Vertical offset of the window.
  940.  
  941.     <integer> = ScreenColors    - Number of Colors (same as WindowColors)
  942.  
  943.     <integer> = ScreenWidth    - Width of the screen.
  944.  
  945.     <integer> = ScreenHeight    - Height of the screen.
  946.  
  947.     <integer> = ScreenX    - Horizontal offset of the screen.
  948.  
  949.     <integer> = ScreenY    - Vertical offset of the screen.
  950.  
  951.     «logical» = Interlace    - TRUE when the screen is Interlace.
  952.  
  953.     «logical» = Hires        - TRUE when the screen is High-Resolution.
  954.  
  955.     «logical» = NTSC        - TRUE when NTSC Amiga; FALSE for PAL.
  956.  
  957.                                      6-37
  958.  
  959.                            Brush Animation Commands
  960.  
  961.     The Brush Animation Commands allow you to show, move, and control
  962. DPaint III BrushAnims.
  963.     You simply load the animation into a buffer using the LoadBrushAnim
  964. Command. The ShowBrushAnim Command begins the animation on the screen. You can
  965. specify a velocity for movement with the MoveBrushAnim Command, along with an
  966. acceleration rate. Or you can use the MoveBrushAnimTo Command, which moves the
  967. brush animation from it's current location to a distination with a specified
  968. velocity and duration.
  969.  
  970. Features    * Use of DPaint III brush animations complete with the Forward,
  971.       Reverse, PingPong, and Duration parameters.
  972.     * Showing of multiple animations at the same time.
  973.     * Movement of animations in your window with full clipping.
  974.     * Real-time decompression in which each frame is decompressed into
  975.       chip memory as needed, or
  976.     * One-time decompression in which all frames are decompressed into
  977.       chip memory. This uses more memory but provides faster animations.
  978.     * Restoration of the background when the BrushAnims move.
  979.     * Support for Transparent brush animations.
  980.     * Sequenced animation that shows each frame in an animation before
  981.       moving.
  982.  
  983.  
  984. LoadBrushAnim "filename" {, "BrushAnim Name" {, loadflags } }
  985.  
  986.     The LoadBrushAnim Command reloads a DPaint III style brush animation.
  987. The "filename" contains the file specification for the animation to be loaded.
  988. The optional "BrushAnim Name" allows you to refer to the brush animation by a
  989. name other than the "filename".
  990.  
  991.  
  992. ShowBrushAnim "BrushAnim Name" , < X > , < Y >
  993.  
  994.     Adds the indicated brush animation to the window. The "BrushAnim
  995. Name" indicates the DPaint III style brush animation to show. The name can be
  996. a file specification or a name created using the LoadBrushAnim Command. If the
  997. file is not already in memory, it will be loaded. The <X>,<Y> indicate the
  998. initial location of the brush animation, before you can move it using either
  999. the MoveBrushAnimTo or MoveBrushAnim Commands. Ind addition, a BrushAnim must
  1000. be shown to allow Animation Object's Scripts to be performed.
  1001.  
  1002.  
  1003. MoveBrushAnimTo "BrushAnim Name" , < X > , < Y > {, ticks }
  1004.  
  1005.     Moves the brush animation to the specified <X>,<Y> coordinates. If
  1006. <ticks> are not provided, the BrushAnim will move instantly. Otherwise,
  1007. movement will occur over the time specified iin <ticks>. If you have an
  1008. Animation Object watching this BrushAnim that has an OnDestination script
  1009. defined, it will be performed when the BrushAnim arrives at the specified
  1010. location.
  1011.  
  1012.                                      6-38
  1013.  
  1014. MoveBrushAnim "BrushAnim Name" , <Xvel>,<Yvel>,{ <Xacc>,<Yac > { <ticks> } }
  1015.  
  1016.     The MoveBrushAnim Command moves a currently displayed brush animation
  1017. "BrushAnim Name" in a direction and acceleration indicated bu the
  1018. <Xvel>,<Yvel>,<Xacc> and <Yacc> values.
  1019.     The <Xvel>,<Yvel> are the velocity values are added to the x,y
  1020. Movement (default) then the velocity values are added after each frame. If the
  1021. brush animation has Sequenced Movement, then the velocity values are added
  1022. after each animation sequence.
  1023.     The optional <Xacc>,<Yacc> are the acceleration values that are added
  1024. to the valocity values after each time they are added to the X,Y values. This
  1025. will cause the movement of the brush to accelerate. If they are not specified,
  1026. they default to 0. This causes the animation to move at a constant velocity.
  1027.     The optinal <ticks> value indicates the number of frams to move in
  1028. the specified direction. After it has moved for the specified number of
  1029. frames, it will stop. If you have an Animation Object watching this BrushAnim
  1030. that has an OnDestination script defined, it will be performed when the
  1031. BrushAnim arrives at the specified location.
  1032.     If the <ticks> is not specified, the animation will move continuously
  1033. in the indicated direction.
  1034.  
  1035.  
  1036. GetBrushAnimCoordinates "BrushAnim Name" , Xvariable , Yvariable
  1037.  
  1038.     Returns the x,y coordiantes of the brush animation in the indicated
  1039. variables.
  1040.  
  1041.     Example:
  1042.         GetBrushAnimCoordiantes "Helicopter",HeliX,HeliY
  1043.  
  1044.     This instruction will put the x location into the variable HeliX and
  1045. the y location into the variable HeliY.
  1046.  
  1047.  
  1048. RemoveBrushAnim "BrushAnim Name"
  1049.  
  1050.     The RemoveBrushAnim Command stops animating the specified "BrushAnim
  1051. Name". However, it does not erase it from the window and does not remove the
  1052. BrushAnim from memory. The BrushAnim can be removed from memory with Flush
  1053. Command.
  1054.  
  1055.                                      6-39
  1056.  
  1057. SetBrushAnimFlags "BrushAnim Name" , < brushanimflags > [, { ticks } ]
  1058.  
  1059.     This Command is used to specify some options for the specified
  1060. "BrushAnim Name". If the brush animation is not currently in memory, it will
  1061. be loaded.
  1062.     The brushanimflags are keywords that indicate specific options. Make
  1063. sure that you do not separate the keywords with commas.
  1064.  
  1065.     COMPRESSEDMODE or DECOMPRESSEDMODE
  1066.     indicates how the animation is kept in memory.
  1067.     COMPRESSEDMODE is the default mode; it takes less memory. However, it
  1068.     takes move time to animate because each frame must be created before
  1069.     it can be displayed.
  1070.  
  1071.     RESTOREBACKGROUND or LEAVEIMAGE
  1072.     indicates whether CanDo should save and restore the background each
  1073.     time the animation is shown. When RESTOREBACKGROUND option is used,
  1074.     you can move the animation without leaving a trail. However, it can
  1075.     substantially slow down the animation. LEAVEIMAGE is the default
  1076.     mode.
  1077.  
  1078.     USEMASK or NOMASK
  1079.     is the same thing as transparent mode for normal brushes. The
  1080.     background color saved with the Brush Animation is transparent when
  1081.     is it displayed. The USEMASK option increases the time required to
  1082.     display each animation frame, especially in COMPRESSEDMODE.
  1083.  
  1084.     SEQUENCEDMOTION or LINEARMOTION
  1085.     specifies how the animation is moved. SEQUENCEDMOTION shows each
  1086.     frame of the animation before moving it. LINEARMOTION moves the
  1087.     animation on each frame. SEQUENCEDMOTION only effects the
  1088.     MoveBrushAnim Command and not the MoveBrushAnimTo Command.
  1089.  
  1090.     FORWARD, BACKWARD and PINGPONG
  1091.     specify the order in which the animation's frames are shown. FORWARD
  1092.     plays the animation from first frame to last. BACKWARD plays the
  1093.     animation from last frame to first. PINGPONG switches between forward
  1094.     and backward motion each time the first or last frame of the animation
  1095.     is displayed.
  1096.  
  1097.                                      6-40
  1098.  
  1099.     NONE
  1100.     changes no flags. It simply allows you to specify the <ticks> without
  1101.     changing any flags.
  1102.  
  1103.     <ticks>
  1104.         The <ticks> value indicates how many ticks to remain on each
  1105.     frame of the animation.
  1106.  
  1107.  
  1108. BrushAnims «logical expression»
  1109.  
  1110.     When the «logical expression» is FALSE it stops all animations. When
  1111. it is TRUE it starts all animations.
  1112.  
  1113.  
  1114. Function
  1115.  
  1116.     The Function can be used in expressions to return information
  1117. relating the Brush Animation Commands.
  1118.  
  1119.  
  1120. FrameOfAnimation <integer> = FrameOfAnimation ( "BrushAnim Name" )
  1121.  
  1122.     The FrameOfAnimation Function returns the current frame number of the
  1123. specified "BrushAnim Name". If the Brushanim has not been loaded, the
  1124. FrameOfAnimation Function will return 0.
  1125.  
  1126.  
  1127. System Variable «logical» = AnimationStatus -TRUE if animations are currently
  1128.                     running in your window.
  1129.  
  1130.                                      6-41
  1131.  
  1132.                            Audio Scripting Commands
  1133.  
  1134.     The Audio Commands play Mono (non-stereo) digitized sounds. The Amiga
  1135. IFF standard for these sounds is called 8SVX. CanDo loads these sounds and
  1136. plays them through one of the four Audio Channels.
  1137.  
  1138.  
  1139. LoadSound "Filename" {, "Sound Name" }
  1140.  
  1141.     The LoadSound Command loads an 8SVX sampled sound. The Optional
  1142. "Sound Name" allows you to refer to it be a name other than the Filename.
  1143. Loadsound pre-loads the sound before playing it. It can then be used in a
  1144. PlaySound or PlaySoundSequence command. This command is particularly useful
  1145. for loading a sound during the Card's StartUp Script. By preloading it, there
  1146. will not be a delay the first time the sound is played.
  1147.  
  1148.     Examples:
  1149.         LoadSound "sounds:Laugh.snd"
  1150.         PlaySound "sounds:Laugh.snd"
  1151.         Loadsound "sounds:Bang.snd","Bang"
  1152.         PlaySound "Bang"
  1153.  
  1154.  
  1155. PlaySoundSequence "Sound Name" {, AudioFlags {, < period > } }
  1156.  
  1157.     The PlaySoundSequence Command plays a list of sounds. The list is
  1158. contained in a Document (see Document Commands). A Document is just like a
  1159. text editor. The PlaySoundSequence plays each "Sound Name" in the Document one
  1160. after another. Each "Sound Name" must be on a separate line. It can be file
  1161. specification or a Name created using the LoadSound Command.
  1162.  
  1163.     Example:
  1164.         MakeDocument "Shooting Sequence"
  1165.         Type "sounds:WatchOut.snd",NEWLINE
  1166.         Type "sounds:Bang.snd",NEWLINE
  1167.         Type "sounds:YouGotMe.snd",NEWLINE
  1168.         PlaySoundSequence "Shooting Sequence"
  1169.  
  1170.                                      6-42
  1171.  
  1172. Audio Flags
  1173.  
  1174. ONCE,
  1175.  
  1176.     which is the default, indicates the sound should only be played one
  1177. time.
  1178.  
  1179.     Example:
  1180.         PlaySound "Bang",ONCE
  1181.  
  1182.  
  1183. CONTINUOUS
  1184.  
  1185.     indicates the sound should be repeated until an AUDIO OFF Command is
  1186. executed.
  1187.  
  1188.     Example:
  1189.         PlaySound "Music",CONTINUOUS,600
  1190.  
  1191.  
  1192. WAIT
  1193.  
  1194.     When WAIT is specified, the sound begins to play when an AUDIO ON is
  1195. executed. This can be used to start multiple sounds at the same time.
  1196.  
  1197.     Examples:
  1198.         PlaySound "sound1",WAIT
  1199.         PlaySound "sound2",WAIT
  1200.         PlaySound "sound3",WAIT
  1201.         Audio ON
  1202.  
  1203.  
  1204. QUEUE
  1205.  
  1206.     Normally, a sound will only play when an Audio Channel is available
  1207. at the time PlaySound Command is performed.
  1208.     QUEUE is like telling the sound to wait in line until an Audio
  1209. Channel is available. As soon as one is, the sound will begin to play. There
  1210. is no limit to the number of sounds that can be queued.
  1211.  
  1212.  
  1213. QUEUEPREVIOUS
  1214.  
  1215.     is similar to QUEUE. Instead of playing on any channel, if one is
  1216. available, it will play on the same channel as the most previous sound.
  1217.  
  1218.     Examples:
  1219.         PlaySound "sounds:WatchOut.snd"
  1220.         PlaySound "sounds:Bang.snd",QUEUEPREVIOUS
  1221.         PlaySound "sounds:YouGotMe.snd",QUEUEPREVIOUS
  1222.  
  1223.  
  1224. < period >
  1225.  
  1226.     The optional period value overrides the sound's natural period/rate
  1227. saved within the 8SVX sound file. This value can range from 124, being the
  1228. fastest, to 65535 being the slowest.
  1229.  
  1230.                                      6-43
  1231.  
  1232. Setvolume < volume > , {, < channel >
  1233.  
  1234.     The SetVolume Command sets the volume for subsequently played sounds.
  1235. It does not change the volume of currently playing sounds.
  1236.     The Volume is an integer ranging from 0, being no volume, to 64 being
  1237. full volume.
  1238.     The Channel number is optional. When it is not specified, the
  1239. indicated volume is used for all channels. On the other hand, specifying a
  1240. channel between 0 and 3 sets the volume for a single channel.
  1241.  
  1242.     Examples:
  1243.         SetVolume 64
  1244.         SetVolume 32,3
  1245.  
  1246.  
  1247. SetChannel < channel >
  1248.  
  1249.     The SetChannel allows you to specify the channel that is used for the
  1250. next PlaySound or PlaySoundSequence command. Usually, these commands look for
  1251. any available channel. If one is available, it plays the sound.
  1252.  
  1253.     NOTE:
  1254.         If you are running another application that is using the
  1255. specified channel, the sound will not be palyed.
  1256.  
  1257.  
  1258. AUDIO « logical expression »
  1259.  
  1260.     This Command turns all Audio Channels ON or OFF. The logical
  1261. expression is evaluated to TRUE or FALSE (ON = TRUE and OFF = FALSE). When the
  1262. expression is TRUE (ON), all PlaySounds using the WAIT keyword are started.
  1263. When the expression is FALSE, all sounds (regardless of the WAIT usage) will
  1264. be terminated.
  1265.  
  1266.                                      6-44
  1267.  
  1268.                               Document Commands
  1269.  
  1270.     A Document is simply a data area that contains text. Using CanDo's
  1271. Memo Object, you can frad from, and type text into a Document. The List Object
  1272. allows you to select lines from a Document.
  1273.     This section describes the CanDo scripting Commands that work with
  1274. Documents. These Commands allow you to work with a Document in the same manner
  1275. as you would from a Text Editor.
  1276.     Commands such as Type, work as though you were typing characters from
  1277. a keyboard. Type "Hello World" enters the text "Hello World" into a Document.
  1278. A cursor position is maintained for each Document. Typing text into the
  1279. document occurs at the cursor position.
  1280.     Cursor movement Commands, such as 'MoveCursor LEFT 5', moves the
  1281. cursor in the document. The Delete Command remove characters at the cursor
  1282. position.
  1283.     The Commands LoadDocument and SaveDocument allow you to load and save
  1284. text files.
  1285.     The Memo and List objects show the contents of a single Document. The
  1286. Document is specified in the Document Definition Requestor in the "Document
  1287. Name" field. This makes the contents of the Document Visible in the Object.
  1288. However, you can create Documents that are not visible. These can be
  1289. particularly useful in working with text "behind the scenes". For example,
  1290. some applications may copy portions of an invisible Document into visible
  1291. Documents.
  1292.     While CanDo provides a number of Commands that work with documents,
  1293. not all are necessary for use in simple applications. This section is
  1294. organized with the most common and necessary Commands listed first. The last
  1295. part of this section describes the CanDo Variables that give information about
  1296. the current document.
  1297.     First, it is necessary to create an empty document. This is done
  1298. using the MakeDocument Command.
  1299.  
  1300.  
  1301. MakeDocument "Document Name"
  1302.  
  1303.     This Command creates an empty document that is identified the
  1304. "Document Name" string. The new Document becomes the Current Document. This
  1305. means Document Commands, such as Type, work with the new document.
  1306.     CanDo applications can have more than one Document. However, the
  1307. Document Commands only work with one Document at a time. The Command
  1308. WorkWithDocument Command specifies the new Current Document.
  1309.  
  1310.                                      6-45
  1311.  
  1312. WorkWithDocument "Document Name"
  1313.  
  1314.     This Command changes the current Document. All subsequent Document
  1315. Commands will use the indicated Document. To work with a Document that is
  1316. visible through a Memo or List Object, you should specify the name indicted in
  1317. the "Document Name" field of the Document Definition Requestor.
  1318.     If the Document specified with the "Document Name" does not currently
  1319. exist, CanDo will make a new Document with the specified name. Furthermore, it
  1320. will attempt to automatically load a file using the "Document Name" as a file
  1321. specification. If the file does not exist, it will create an empty document.
  1322. This allows you to easily create a document and load it with a file if it
  1323. exists. However, if you do not want CanDo to attempt to load a file, you must
  1324. first create the document usign the MakeDocument Command.
  1325.  
  1326.  
  1327. LoadDocument "Filename" {, "Document Name" }
  1328.  
  1329.     Reads the contents of the specified "Filename" into a "Document
  1330. Name". If a Document with a name of "Document Name" currently exists, it will
  1331. clear the document before loading the document.
  1332.  
  1333.  
  1334. SaveDocument "Document Name" {, "Filename" }
  1335.  
  1336.     The SaveDocument Command saves the specified "Document Name". When
  1337. the "Filename" is not specified, CanDo will replace the file that was
  1338. originally loaded or use the "Document Name" as a filename if the Document was
  1339. not loaded. If the "Filename" is specified, it will use it as the filename.
  1340.  
  1341.  
  1342. Type "string" {, NEWLINE }
  1343.  
  1344.     This Command "Type's" the string into the current Document. The
  1345. string can contain imbedded LF's for RETURNs, DELETE's and BACKSPACE's. These
  1346. characters can be created using the Char Function.
  1347.  
  1348.     Example:
  1349.         Type "Hello" || World
  1350.  
  1351.     This example concatenates the string constant "Hello" with the
  1352. contents of the variable World, and types it into the current Document.
  1353.  
  1354.                                      6-46
  1355.  
  1356. SplitLine { < count > }
  1357.  
  1358.     This Command is the same as a RETURN key. The optinal <count>
  1359. specifies the number of times to repeat the Command.
  1360.  
  1361.     Examples:
  1362.         SplitLine
  1363.         SplitLine 5
  1364.  
  1365.  
  1366. NewLine
  1367.  
  1368.     This Command is the same as moving the cursor to the end of the line
  1369. and pressing the RETURN key. It does not have any parameters. It is a useful
  1370. Command for creating a new line without any concern whether the cursor is
  1371. currently in the middle of a line.
  1372.  
  1373.  
  1374. MoveCursor direction {, < count > }
  1375.  
  1376.     Moves the cursor in the specified direction. If no count is
  1377. specified, the sursor moves once. Otherwise, it moves the direction the nymber
  1378. of times specified in the count. If the count is negative, the count moves in
  1379. the opposite direction.
  1380.  
  1381.     DIRECTION -You can only use one of the direction keywords.
  1382.  
  1383.         UP
  1384.             Moves the cursor Up. This Command has no effect
  1385.         when the cursor reaches the first line in the Document.
  1386.  
  1387.         DOWN
  1388.             Moves the cursor Down. This Command has no effect
  1389.         when the cursor reaches the last line in the Document.
  1390.  
  1391.         LEFT
  1392.             Moves the cursor Left. If the cursor is at the
  1393.         beginning of a line (and it is not the last line in the
  1394.         Document), it moves to end of the previous line.
  1395.  
  1396.         RIGHT
  1397.             Moves the cursor Right. If the cursor is at the end
  1398.         of a line (and it is not the last line in the Document), it
  1399.         moves to the beginning of the Next line.
  1400.  
  1401.     Examples:
  1402.         MoveCursor UP
  1403.         MoveCursor RIGHT,10
  1404.         MoveCursor RIGHT,RepeatCount+5
  1405.  
  1406.                                      6-47
  1407.  
  1408. MoveCursorTo location area
  1409.  
  1410.     This Command moves the cursor to the cursor to the start of or to the
  1411. end of the current Document, line, word, previous word, or next word.
  1412.  
  1413.     LOCATION -You can only use one of the direction keywords.
  1414.  
  1415.         STARTOF
  1416.             Indicates to move the cursor to the beginning of
  1417.         the specified Area.
  1418.  
  1419.         ENDOF
  1420.             Indicates to move the cursor to the end of the
  1421.         specified Area.
  1422.  
  1423.     AREA -You can only use one of the direction keywords.
  1424.  
  1425.         DOCUMENT
  1426.             Moves the cursor to the specified Location within
  1427.         the current Document.
  1428.  
  1429.         LINE
  1430.             Moves the cursor to the specified Location on the
  1431.         current line.
  1432.  
  1433.         NEXTWORD
  1434.             Moves the cursor to the specified Location on the
  1435.         word after tue current word.
  1436.  
  1437.         THISWORD
  1438.             Moves the cursor to the specified Location on the
  1439.         current word. If the cursor is not on a word, this Command
  1440.         will not have any effect.
  1441.  
  1442.         PREVIOUSWORD
  1443.             Moves the cursor to the specified Location on the
  1444.         word before the current word.
  1445.  
  1446.     Examples:
  1447.         MoveCursorTo STARTOF DOCUMENT
  1448.         MoveCursorTo ENDOF LINE
  1449.         MoveCursotto STARTOF NEXTWORD
  1450.  
  1451.  
  1452. PositionOnLine < line >
  1453.  
  1454.     Moves the cursor to the specified Line. If the specified line number
  1455. is greater than the number of lines in the Document, the cursor is placed on
  1456. the last line. The cursor offset is not effected.
  1457.  
  1458.                                      6-48
  1459.  
  1460. Clear LINE or DOCUMENT
  1461.  
  1462.     This Command clears either the current Line or the current Document.
  1463.  
  1464.     LINE
  1465.         Indicates to clear the current line. This is different than
  1466.     deleting the line. All characters are erased, but the line remains
  1467.     with the cursor in the first column.
  1468.  
  1469.     DOCUMENT
  1470.  
  1471.         Indicates to clear the current Document. This is different
  1472.     than deleting the Document. The Document still exists with all the
  1473.     characters erased.
  1474.  
  1475.     Examples:
  1476.         Clear LINE
  1477.         Clear DOCUMENT
  1478.  
  1479.  
  1480. Delete KeyWord {, < count > }
  1481.  
  1482.     This Command deletes speicfied text from the current Document. An
  1483. optional count indicates the number of times to repeat the action. (while the
  1484. syntax allows it, a count used with ToStartOfLine and ToEndOfLine has no
  1485. effect). Only one Keyword may be specified.
  1486.  
  1487.     KeyWord -You can only use one of the direction keywords.
  1488.  
  1489.     LINE
  1490.         Deletes the current Line. This removes the line completely,
  1491.     positioning the cursor at the beginning of the next line.
  1492.  
  1493.     TOSTARTOFLINE
  1494.         Deletes all characters before the cursor to the beginning of
  1495.     the line. (count has no effect).
  1496.  
  1497.     TOENDOFLINE
  1498.         Deletes all characters from the cursor to the end of the
  1499.     line. This includes the current character.
  1500.  
  1501.                                      6-49
  1502.  
  1503.     CHARACTER
  1504.         If no count is specified, a single character is deleted to
  1505.     the right of the cursor location. Otherwise, the count specifies the
  1506.     number of characters to delete. If the count is positive, then
  1507.     characters are deleted to the right of the cursor. When the count is
  1508.     negative, characters are deleted to the left of the cursor. This is
  1509.     the same as a Backspace. When the count is greater than the number of
  1510.     characters remaining on the line, the current line is concatenated
  1511.     with the next line (previous line in the case of a backspace). This
  1512.     concatenation will count as a deleted character.
  1513.  
  1514.     Examples:
  1515.     Delete LINE        ; Deletes a single line.
  1516.     Delete LINE 5        ; Deletes 5 lines.
  1517.     Delete TOSTARTOFLINE    ; Deletes to the beginning of a line.
  1518.     Delete CHARACTER        ; Deletes a single character.
  1519.     Delete CHARACTER 5    ; Deletes 5 characters.
  1520.     Delete CHARACTER -Repeat    ; Backspaces <repeat> times.
  1521.  
  1522.  
  1523. SearchFor "text" {, qualifiers }
  1524.  
  1525.     Searches for the specified string. The qualifiers allow seacrhing for
  1526. complete words and for ignoring case differences.
  1527.  
  1528.     Qualifiers -You can use one of both BYWORD and NOCASE.
  1529.  
  1530.         BYWORD
  1531.             This qualifier allows searching for complete words.
  1532.         The search will not match a string if it is a portion of a
  1533.         word.
  1534.  
  1535.         NOCASE
  1536.             This qualifier allow searching for a string
  1537.         ignoring case differences between the search string and the
  1538.         potential target string.
  1539.  
  1540.     Examples:
  1541.         SearchFor "FooMan Chew"
  1542.         SearchFor "is",BYWORD
  1543.         SearchFor "bald",NOCASE BYWORD
  1544.  
  1545.                                      6-50
  1546.  
  1547. Replace "fromtext","totext" { , { GLOBAL } { BYWORD } { NOCASE } }
  1548.  
  1549.     The Replace Command replaces the "fromtext" with the "totext". It wil
  1550. search forward from the current cursor location for the "fromtext". If the
  1551. "fromtext" is not found, nothing will happen. If it is found, the cursor will
  1552. be moved to the character following the new "totext".
  1553.  
  1554.     Qualifiers -You can use one or more qualitiers with the Replace
  1555.            Command.
  1556.  
  1557.     GLOBAL replace all remaining matches of the "fromtext" with the
  1558.     "totext string. When if is not specified, only one replace can
  1559.     potentially be replaced.
  1560.  
  1561.     BYWORD indicates the "fromtext" will match if it is contained within
  1562.     a word.
  1563.  
  1564.     NOCASE indicates the "fromtext" will match even if some of the
  1565.     characters are not the same. If NOCASE is not specified, it must match
  1566.     exactly.
  1567.  
  1568.  
  1569. InsertDocument "Document Name" { , < Start Line > { , < LineCount > } }
  1570.  
  1571.     The InsertDocument Command copies the text from the specified
  1572. "Document Name" into current document at the current cursor position. The
  1573. optional < Start Line > specifies the first line, from the "Document Name" to
  1574. copy. When it is not specified, it starts on line 1. The optional < LineCount
  1575. > indicates the number of lines to copy. If it is not specified, all lines
  1576. after the < Start Line > are copied.
  1577.     If the "Document Name" does not exist, CanDo will attempt to
  1578. automatically load it using the "Document Name" as the file specification.
  1579.  
  1580.     Examples:
  1581.         InsertDocument "Work Document"
  1582.         InsertDocument "S:startup-sequence"
  1583.         InsertDocument "My Resume",5
  1584.         InsertDocument "DF1:WorkFile.TXT",25,10
  1585.  
  1586.                                      6-51
  1587.  
  1588. SetWordDelimiters "delimiterlist"
  1589.  
  1590.     This Commands sets the word delimiter list. The word delimiters
  1591. define the characters that separate words. The default delimiters are
  1592. , ( ) ! @ # $ % ^ & * _ = + \ | < > ? / in addition to the TAB characters of
  1593. the word delimiters on both sides of the word.
  1594.     The "delimiterlist" string contains the delimitating characters for
  1595. words. This string can be any size. The beginning and ending of a line are
  1596. always word delimiters. As such, they are not explicitly in the list, but any
  1597. expression.
  1598.  
  1599. < Integer > = TheLineNumber     - line number the cursor is on.
  1600.  
  1601. < Integer > = TheColumnNumber   - column number the cursor is on.
  1602.  
  1603.  " String " = TheLine         - the character string for the current line.
  1604.  
  1605.  " String " = TheCharacter      - the character the cursor is on
  1606.                    ("" if at the end of line).
  1607.  
  1608.  " String " = TheWord         - the current word the cursor is on.
  1609.                    This value is based on the word delimiters.
  1610.  
  1611.  " String " = CharsToBegOfLine  - the characters before the cursor on the
  1612.                    current line.
  1613.  
  1614.  " String " = CharsToEndOfLine  - the characters from the cursor to the end of
  1615.                    the line.
  1616.  
  1617. < Integer > = LinesInDocument   - the number of lines on the current document.
  1618.  
  1619. < Integer > = LengthOfLine      - the length of the current line.
  1620.  
  1621. < Integer > = SizeOfDocument    - the number of bytes in the current document.
  1622.  
  1623.  " String " = DocumentName      - the name of the current document.
  1624.  
  1625. < Integer > = SizeOfDocument    - number of characters in document.
  1626.  
  1627.  " String " = TheWordDelimiters - the characters separating words in the
  1628.                    current document.
  1629.  
  1630.                                      6-52
  1631.  
  1632.                               File I/O Commands
  1633.  
  1634.     The File I/O Commands provide an easy way to write and read data from
  1635. files. CanDo uses the Amiga's Buffered I/O system for implementing these
  1636. commands. While the commands are not complicated, they are imtended for those
  1637. who are fimilar with File I/O.
  1638.     If you are mostly interested in working with text files, you might
  1639. want to consider using the Document commands.
  1640.  
  1641. OpenFile "filename" , "buffername" , IOFlags , AccessFlags
  1642.  
  1643.     Opens a file for input / output purposes. Memory is the only limit to
  1644. the number of opened files that can be open at one time. The "filename"
  1645. specifies the file to be opened. The "buffername" is a string used to identify
  1646. the buffer associated with this file access.
  1647.     The IOFlags are READONLY or WRITEONLY. READONLY indicates that you an
  1648. only read ASCII data from the file. WRITEONLY means that you can only write
  1649. ASCII data to the file.
  1650.     The AccessFlags are NEWFILE, OLDFILE or APPEND. NEWFILE indicates to
  1651. create a new file. If the specified file already exists, then it is deleted.
  1652. OLDFILE indicates to open an existing file. If it does not currently exist, it
  1653. is created. This is the DEFAULT operation. APPEND is similar to OLDFILE,
  1654. except it will position all writes to the end of the file.
  1655.  
  1656.     Example:
  1657.         OpenFile "t:Savedata.txt" , "Data" , READONLY , OLDFILE
  1658.  
  1659.  
  1660. FileWriteLine "buffername", "String"
  1661.  
  1662.     This command will output the "String" to the file referenced by the
  1663. "buffername". An important note about this command is that it will output a
  1664. linefeed at the end of each write. The file associated with the "buffername"
  1665. must have been opened in WRITEONLY mode for this command to work.
  1666.  
  1667.     Examples:
  1668.         FileWriteLine "Data" , "This is a Data Line."
  1669.  
  1670.         Let OutputData = Outputdata || "additional data"
  1671.         FileWriteLine "Data" , OutputData
  1672.  
  1673.  
  1674. FileReadLine "buffername" , VariableName
  1675.  
  1676.     The FileReadLine Command reads a line from a previously opened file.
  1677. It creates a string and saves it in the specified VariableName. A line from
  1678. the file is defined to be a string terminated with a line feed.
  1679.  
  1680.     Example:
  1681.         FileReadLine "Data File" , DataLine
  1682.  
  1683.                                      6-53
  1684.  
  1685. FileReadChars "buffername" , VariableName , < NumberOfChars >
  1686.  
  1687.     This command reads a specified number of characters, <NumberOfChars>,
  1688. from a previously opened file, "buffername". These characters are stored in
  1689. the VariableName.
  1690.  
  1691.     Example:
  1692.         FileReadChars "Input File" , FiveChars , 5
  1693.  
  1694.  
  1695. FileWriteChars "buffername" , "String" { , < length > }
  1696.  
  1697.     This command will output the characters contained in "string" to the
  1698. file associated with the "buffername". This command differs from the
  1699. FileWriteLine in that this command will NOT output a linefeed after each
  1700. write. The referenced file must have been previously opened in WRITEONLY.
  1701. There is an optional argument that specifies how many characters to output. If
  1702. the length specified is greater than the length of "expression" is shorter
  1703. than the specified <length>, spaces are NOT concatenated to the string.
  1704.  
  1705.     Example:
  1706.         FileWriteChars "Data",Outdata || spaces, 20
  1707.  
  1708. SetFileBufferSize < sizeinkilos >
  1709.  
  1710.     This command sets the file input / output buffer size in kilobytes.
  1711. The default for the buffer size is four (4) kilobytes. A value of 8, allocates
  1712. 8192 byte buffer. The buffer size is set on a file basis. This command only
  1713. changes the buffer size files opened after the command is issued.
  1714.  
  1715.     Example:
  1716.         SetFileBufferSize 2
  1717.         OpenFile "t:WorkFile.dat" , "WorkData" , READONLY , OLDFILE
  1718.  
  1719.  
  1720. Close "buffername"
  1721.  
  1722.     This command closes the file associated with the specified Data Name.
  1723. The 'Flush' command performs the same function when used with a "buffername".
  1724. Any buffered changes that you have made to the file will be written to the
  1725. file at this time.
  1726.  
  1727.                                      6-54
  1728.  
  1729.                                 Icon Commands
  1730.  
  1731.     Most application programs on the Amiga have a file that goes with
  1732. them called an icon file. All such icon files end with the letters ".info".
  1733. These files contain imagery that Workbench uses to display a visual
  1734. representation of the application on the Workbench screen of in various
  1735. Workbench windows. Most diskettes and many data files also have icon files.
  1736. With CanDo, you can easily create, examine, and modify icons without knowing
  1737. any of the details of the icon file internal format.
  1738.  
  1739.  
  1740. LoadIcon "filename" { , "Name" { , < load flags > } }
  1741.  
  1742.     Loads the icon for the "filename" into memory. The extension of
  1743. ".info" is automatically appended to the filename. Therefore, to load the icon
  1744. for CanDo you would type, LoadIcon "CanDo". Any valid Amiga icon can be loaded
  1745. with the command, althought only Project and Tool icons can be created using
  1746. the MakeIcon Command.
  1747.  
  1748.  
  1749. SaveIcon "Icon Name" { , "filename" }
  1750.  
  1751.     This command saves the icon buffer "Icon Name" as the icon for the
  1752. "filename" indicated. The extension of ".info" is automatically appended to
  1753. the filename. This command will overwrite any icon that already exists for the
  1754. "filename". If the "filename" parameter is not included, CanDo will save the
  1755. file using the original file name or use the "Icon Name" as the file
  1756. specification if it was created using the MakeIcon Command.
  1757.     If the icon "Icon Name" is not already in memory, it will be loaded
  1758. and then saved, so you can easily copy an icon from disk to a new name without
  1759. first loading it.
  1760.  
  1761.     Example:
  1762.         SaveIcon "fred","ram:Jack"
  1763.         Fluse "fred"
  1764.  
  1765.     This script would load the icon file "fred.info" from disk (assuming
  1766. it was not already in memory) and save it into a file called "ram:Jack.info".
  1767. The "fred" icon buffer in memory would then be flused.
  1768.  
  1769.                                      6-55
  1770.  
  1771. MakeIcon "Icon Name" , PROJECT or TOOL , "ImageName" { , "AltImageName" }
  1772.  
  1773.     This command creates an icon buffer with the given "Icon Name". You
  1774. must specify whether this icon is to be a PROJECT or a TOOL icon (explained
  1775. below), and you must indicate a Brush to use for the image of the icon. In
  1776. addition, you may specify a Brush buffer to use for the highlight of the icon
  1777. when it is clicked on with the mouse on Workbench. If you do not specify an
  1778. AltImage Brush, the icon will complement when clicked. If either the
  1779. "ImageName" or the "AltImageName" brushes are not in memory currently, they
  1780. will be loaded from disk and buffers for them will be created using the
  1781. indicated names.
  1782.     Once an icon has been created in this way, it can be saved to disk
  1783. with the SaveIcon Command.
  1784.  
  1785.     Examples:
  1786.         MakeIcon "MyProject" , PROJECT , "Brushes:WorkIcon.br"
  1787.  
  1788.         MakeIcon "MyProject" , PROJECT , "Brushes:WorkIcon1.br" ,
  1789.             "Brushes:Tools2.br"
  1790.  
  1791.  
  1792. SetDefaultTool "Icon Name" , "DefaultTool"
  1793.  
  1794.     This command sets the Default Tool of the icon "Icon Name". If "Icon
  1795. Name" is not already in memory, it will be loaded. The Default Tool of an icon
  1796. is the application that will be run if the icon is double-clicked on Workbench
  1797. and is itself not an application. For example, many paint programs make icons
  1798. for the pictures and brushes that they save. When the icon is double-clicked
  1799. the paint program that make the icon is launched an it then loads the picture.
  1800.     By using the Info menu command from the Workbench, you can see the
  1801. various default tools specified by icons on your Amiga.
  1802.     When choosing a default tool for icons you create or modify with
  1803. CanDo, it is important to be sure that those applications properly deal with
  1804. being run from the Workbench environment. CanDo and all of your applications
  1805. made with CanDo can run equally well from CLI and Workbench.
  1806.  
  1807.  
  1808. SetIconImage "Icon Name" , "ImageName" { , "AltImageName" }
  1809.  
  1810.     SetIconImage changes the image for "Icon Name" to the Brush
  1811. "ImageName", and, if the "AltImageName" is supplied, will also set the
  1812. highlight of the icon to that image. If the "AltImageName" is not supplid, the
  1813. current highlight mode for the icon will not be changed. If the "Icon Name",
  1814. or either of the Brushes, is not in memory it will be loaded into memory and
  1815. will be given the indicated names.
  1816.     Note; that the size of the "hit area" of the icon will be changed to
  1817. reflect the size of the "ImageName" used in this command.
  1818.  
  1819.                                      6-56
  1820.  
  1821. InsertToolTypeList "Icon Name"
  1822.  
  1823.     This command TYPEs into the current Document all of the ToolTypes for
  1824. the "Icon Name" (see Document commands). A ToolType is any ASCII string that
  1825. contains information about any subject you like. By using the Info command
  1826. from Workbench on the CanDo icon, you will see that it uses many ToolTypes to
  1827. control the default configuration for CanDo. (These ToolTypes can also be set
  1828. through the Workbench Info command).
  1829.     By performing this command when your CanDo application starts, you
  1830. can let your user specify information which your application can use while
  1831. running. For example, you could create a single-card application called
  1832. "Viewer" that performed the following script in its AfterStartup script:
  1833.  
  1834.     LoadIcon TheOriginDirectory || "Viewer"  ;load our own icon
  1835.     MakeDocument "pictures"
  1836.     InsertToolTypeList             ;get the filenames
  1837.     MoveCursorTo StartOf Document
  1838.  
  1839.     While TheLine <> ""             ;continue until a blank line
  1840.         If FileType(TheLine)="pictuers" ;make sure it's OK
  1841.             ShowPicture TheLine    ;show it if so
  1842.  
  1843.             Delay 0,10,0         ;wait for a sec
  1844.         Endif
  1845.  
  1846.         MoveCursor Down             ;go to the next line
  1847.     EndLoop
  1848.  
  1849.     This is a slide-show program created with CanDo in the amount of time
  1850. it takes you to type in the abouve script. The user just puts the name of the
  1851. picture files to show info the icon using the Workbench Info command and then
  1852. runs your program.
  1853.  
  1854.  
  1855. SetToolTypeList "Icon Name" , "DocumemtName"
  1856.  
  1857.     This command takes each line from the indicated Document and makes it
  1858. part of the "Icon Name"'s ToolType list. See InsertToolTypeList above for a
  1859. discussion of the function and merits of ToolTypes.
  1860.  
  1861.  
  1862. Icon Functions
  1863.  
  1864.     These Functions can be used in expression to return information
  1865. relating to the Icon Commands.
  1866.  
  1867.  
  1868. DefaultTool    "String" = DefaultTool ( "Icon Name" )
  1869.  
  1870.     The DefaultTool Function returns the default tool for the icon
  1871. buffer. See the SetDefaultTool Command for more information about DefaultTool.
  1872.  
  1873.  
  1874. IconType        "String" = IconType ( "Icon Name" )
  1875.  
  1876.     The IconType return the icon type for the "Icon Name". If returns a
  1877. string indicating the Type. It returns one of the following: "Project",
  1878. "Disk", "Drawer", "Tool", "NDOS", "Device", "KickStart", and "Uknown".
  1879.  
  1880.                                      6-57
  1881.  
  1882.                                 ARexx Commands
  1883.  
  1884.     ARexx is a high-level language developed be Wiliam Hawes.
  1885. Applications supporting ARexx offer standardized communications using Amiga
  1886. Public Message Ports. An application can create a Public Message Port for
  1887. receiving ARexx messages. A Port created for this purpose is referred to as an
  1888. ARexx Port.
  1889.     CanDo does not internally support ARexx's interpreted language; CanDo
  1890. supports ARexx communications. While the ARexx language itself can be a
  1891. powerful enhancement to your Amiga, it is not required for your CanDo
  1892. application to utilize ARexx communication.
  1893.     Your application can send or receive ARexx messages, or do both. To
  1894. receive messages, you need to create an ARexx Port using the ListenTo command.
  1895. By putting this command in the Startup script of your first Card, you can be
  1896. sure you are ready to receive messages in the Port. The CanDo's ARexx Objects
  1897. allow you to look for specific messages received by the Port. After receiving
  1898. a message, a script can use the System Variable TheMessage to examine the full
  1899. text of the message.
  1900.     CanDo can also send messages to other applications that support
  1901. ARexx. The SpeakTo Command tells CanDo the name of the ARexx Port belonging to
  1902. the application with which you want to communicate. The SendMessage Command
  1903. sends a message to the application through this Port. You can optionally
  1904. receive Results from the application. When sending a message to another
  1905. application, you should consult its documentation regarding its ARexx Port
  1906. name and valid message commands. Of course, you can design your own
  1907. applications using CanDo that communicate using ARexx.
  1908.  
  1909.  
  1910. SpeakTo "PortName"
  1911.  
  1912.     This Command tells CanDo the name of the ARexx Port to send messages
  1913. to. All subsequent SendMessage Commands will send messages to the specified
  1914. "PortName".
  1915.  
  1916.                                      6-58
  1917.  
  1918. SendMessage "MessageText" ( , NORESULTS )
  1919.  
  1920.     The SendMessage Command sends the "MessageText" to the "PortName"
  1921. specified in the most previously executed SpeakTo Command. The optional
  1922. keyword, NORESULTS, indicates that the application does not return a text
  1923. message. If NORESULTS is not specified, the System Variable MessageReturned
  1924. will contain the returned message.
  1925.     The System Variable MessageErrorCode will contain an error code
  1926. returned by the application. By convertion, a ZERO indicates it completed the
  1927. operation. A non-zero value is an application specified error code.
  1928.  
  1929.     Example:
  1930.         SpeakTo "Widget"
  1931.         SendMessage "Do Your Job"
  1932.         If MessageErrorCode <> 0
  1933.             GoToCard "ErrorCard"
  1934.         Endif
  1935.  
  1936.     This example first tells CanDo to send messages to an application
  1937. that has an ARexx Port with a name of "Widget". If then sends the message "Do
  1938. You Job". The System Variable will not be equal to 0 (Zero) if the application
  1939. returned an error condition. This script would cause your CanDo application to
  1940. go to a Card caled "Error Card".
  1941.  
  1942.  
  1943. ListenTo "PortName"
  1944.  
  1945.     This command specifies the name of the "PortName" for receiving
  1946. messages. This is the Public Message Port through which your ARexx Port, CanDo
  1947. will create a Public Message Port by the specified name. If you are changing
  1948. the ListenTo "PortName", the old "PortName" will no longer exist. It is
  1949. considered good practice for your application to have only one "PortName" for
  1950. receiving messages.
  1951.  
  1952.  
  1953. InsertMessagePortList
  1954.  
  1955.     This command TYPE's the list of all Public Message Ports into the
  1956. current Document (see Document Commands). Each Port name will be on its own
  1957. line. Because there are Public Message Ports that do not support ARexx
  1958. messages, you should not haphazardly send messages to just any port in the
  1959. list. Sending a message to a non-ARexx Port can cause the Amiga to crash.
  1960.  
  1961.      "String" = CurrentListenTo  - "PortName" of most recent ListenTo.
  1962.  
  1963.      "String" = CurrentSpeakTo   - "PortName" of most recent SpeakTo.
  1964.  
  1965.     <Integer> = MessageErrorCode - Error Code from previous Return
  1966.                     message.
  1967.  
  1968.      "String" = MessageReturned  - Most recent Return message.
  1969.  
  1970.      "String" = TheMessage      - Last message received through
  1971.                     ListenTo.
  1972.  
  1973.                                      6-59
  1974.  
  1975.                                Object Commands
  1976.  
  1977.     The Object Commands effect various Objects created with CanDo. Many
  1978. of these commands use an "Object Name" as a parameter. The "Object Name"
  1979. should coorespond to the Name specified in an OBJECT'S EDITOR (see Objects
  1980. Documentation for more information).
  1981.  
  1982.  
  1983. DisableObject "Object Name"
  1984.  
  1985.     The "Object Name" identifies a Button, Field, or Document Object.
  1986. This command will make the Object inaccessabel to the user of your application
  1987. and the Object will be displayed as ghosted.
  1988.  
  1989.  
  1990. EnableObject "Object Name"
  1991.  
  1992.     This command will make the Object accessable to the user of your
  1993. application and will display the Object as non-ghosted. Note that simply
  1994. enabling certain types of Objects is not enough to ensure that their
  1995. appearance is the way you want is to be. This can be especially true for
  1996. Fields and Area Buttons. In these cases, a ClearWindow Command may be
  1997. appropriate to use after the EnableObject Command.
  1998.  
  1999.  
  2000. SetObjectState "Object Name" , « logical expression »
  2001.  
  2002.     This command can be used to deselect or select a Button, Field, or a
  2003. Memo Document. When the « logical expression » is TRUE, it will select the
  2004. Object. When it is FALSE it will deselect the Object. For Buttons, selection
  2005. means that the highlighted form of the Button's display is shown in the
  2006. window. For Fields and Memos, selection means that this Object will receive
  2007. keyboard input and a cursor will apear in the Object's hit area.
  2008.  
  2009.  
  2010. FastFeedBack « logical expression »
  2011.  
  2012.     The FastFeedBack Command enables or disables fast feedbask of mouse
  2013. movement for an Object's Drag Script. The Drag Script is performed while the
  2014. left mouse button is pressed and moved over a selected Object. Each time the
  2015. mouse is moved, the Drag Script is performed. It is possible for the mouse to
  2016. move several times while the Drag Script is being performed.
  2017.     When FastFeedBack is disabled, the Drag Script is performed for every
  2018. mouse movement, including the movements that could not be performed while a
  2019. script is being performed. This has the benefit of having the script performed
  2020. at each point in a path. However, this will cause the execution of a script to
  2021. fall behind the current location of the mouse pointer.
  2022.     When FastFeedBack is enabled, the Drag script will skip up to 20
  2023. mouse movements that occurr while a script is being performed. This allows the
  2024. script execution to keep up with mouse movement. However, this means it will
  2025. potentially miss some of the points along the path.
  2026.     If the « logical expression » is TRUE, the fast feedback is enabled.
  2027. Otherwise, it is disabled.
  2028.  
  2029.                                      6-60
  2030.  
  2031. MoveObject "Object Name" , < X > , < Y >
  2032.  
  2033.     The MoveObject Command moves a visible Object in your window. You can
  2034. use the MoveObject Command to move Buttons, Fields, and Documents. The "Object
  2035. Name" is the name specified in the Object's Editor. The <X>,<Y> values are the
  2036. horizontal and vertical coordinates where you want to move it to. NOTE; it is
  2037. possible to move the object off the visible portion of your window.
  2038.  
  2039.  
  2040. SetInteger "Object Name" , < value >
  2041.  
  2042.     The SetInteger Command sets the value displayed in the Integer Field
  2043. indicated by the "Object Name". The "Object Name" is the name specified in the
  2044. FIELD EDITOR REQUESTER. The <value> is the integer value to put into the
  2045. field. The Minimum and Maximum range for this value will be controlled by the
  2046. Limits as Defined in the Field Editor Requester for this field.
  2047.  
  2048.  
  2049. SetText "Object Name" , "Text"
  2050.  
  2051.     The SetText Command sets the string displayed in the String Field
  2052. indicated by the "Object Name". The "Object Name" is the Name specified in the
  2053. FIELD EDITOR REQUESTER. The "Text" is the string value to put into the field.
  2054. No more than the Maximum Number Of Characters (as defined in the Field Editor
  2055. Requester) will be copied into the field.
  2056.  
  2057.  
  2058. IntegerFrom    <Integer> = IntegerFrom ( "Object Name" )
  2059.  
  2060.     The IntegerFrom Function returns the integer currently displayed in
  2061. an Integer Field. The < Integer > value is guaranteed to be between the
  2062. Maximum and Minimum values specified in the INTEGER FIELD REQUESTER.
  2063.  
  2064.  
  2065. TextFrom         "String" = TextFrom ( "Object Name" )
  2066.  
  2067.     The TextFrom Function returns the string currently displayed in Text
  2068. Field. The "Object Name" is the name specified in the FIELD EDITOR REQUESTER.
  2069.  
  2070.  
  2071. ObjectState     «logical» = ObjectState ( "Object Name" )
  2072.  
  2073.                                      6-61
  2074.  
  2075.                                Buffer Commands
  2076.  
  2077.     The data CanDo uses is stored in area of memory called a Buffer.
  2078. Every Picture, Brush, BrushAnim, Document, Sound, File I/O, and Icon, is kept
  2079. in a Buffer. CanDo "manages" these buffers for you automatically. This
  2080. automatic system is designed to relieve the novice user fram concern about
  2081. what can be a complicated problem. For this reason, it is not necessary for
  2082. all CanDo users to concern themselves with using the Buffer Commands. However,
  2083. these commands are provided for the users who may want to change the way the
  2084. automatic system works.
  2085.     Each Buffer has a unique name. The name is simply a "String"
  2086. identifying the Buffer. Most of the time, the name is the file specification
  2087. from which the data was loaded. This is the case when a ShowBrush Command
  2088. needs to load the image before showing it. However, the LoadBrush Command
  2089. allows you to provide some other Buffer Name. (Note: most of the documentation
  2090. avoids the terminology "Buffer" because it would make it seem unnecessarily
  2091. complicated).
  2092.     CanDo keeps track of each Buffer's Name, Data, the file specification
  2093. if the Data came from a file, the Buffer Type, whether it is currently being
  2094. used and if the data has been modified. The purpose of this is to manage the
  2095. memory used by a buffer.
  2096.     Memory is a scarce resource that is in constant demand. The types of
  2097. operations made easy by CanDo canbe a nightmare of details for a programmer in
  2098. another language. For example: when a picture is to be displayed, memory must
  2099. be allocated from a "Pool" that is available to all programs. The picture is
  2100. loaded from a file that was created in a standard format known as IFF. The IFF
  2101. data is loaded from the file and converted to a form that the Amiga Hardware
  2102. can use for displaying the image. For the image to be displayed, it must be
  2103. put into the Amiga's Chip memory. There is a separate Pool for Chip memory.
  2104. When the picture is done being displayed, its memory is given back to the
  2105. Pool.
  2106.     Some of the difficulty occurs when there is not enough memory in one
  2107. of the Pools. There are ways to tell the Amiga Operation System give back
  2108. memory that it is not using any more. If there still is not enough memory, the
  2109. program needs to look for memory it has allocated from the Pool and is not
  2110. currently being used.
  2111.     When CanDo can not get enough memory from a Pool to complete an
  2112. operation, it looks through the Buffers and returns as much memory as it can.
  2113. If the Buffer's Data is not currently being used and it has not been modified.
  2114. CanDo returns the memory being used by the Buffer's Data. However, it keeps
  2115. all of the other information about the Buffer.
  2116.     By keeping the Buffer information and not its data, CanDo can
  2117. automatically reload the data from the file if it ever needed again.
  2118.  
  2119.                                      6-62
  2120.  
  2121. SetAutoLoadFlags ( CHIP and ASNEEDED ) or NONE
  2122.  
  2123.     The LoadFlags Appendix describes how you can control on a file by
  2124. file basis how CanDo keeps the file in memory. However, many of the files are
  2125. automatically loaded without a load command. This is done with commands such
  2126. as ShowBrush and PlaySound. Files are also loaded by some of CanDo's Objects
  2127. such as Image Buttons and Picture Windows.
  2128.     The SetAutoLoadFlags Command allows you to use the loadflags ASNEEDED
  2129. and CHIP for files that are automatically loaded. When ASNEEDED is indicated,
  2130. CanDo automatically returns the Buffer's Data as soon as it is not being used.
  2131. The CHIP keyword indicates the file should be loaded directly into the Amiga's
  2132. Chip memory. While having the Data in Chip running completely out of memory.
  2133. By default the AutoLoadFlags are NONE.
  2134.  
  2135.     Examples:
  2136.         SetAutoLoadFlags ASNEEDED
  2137.  
  2138.         SetAutoLoadFlags CHIP
  2139.  
  2140.         SetAutoLoadFlags CHIP ASNEEDED
  2141.  
  2142.         SetAutoLoadFlags NONE
  2143.  
  2144.  
  2145. Flush "Buffer Name"
  2146.  
  2147.     The Flush Command frees all memory used be the specified "Buffer
  2148. Name". This causes CanDo to forget everything about the Buffer as though it
  2149. was never created. If you Flush a buffer that is curently being used, CanDo
  2150. will Flush it as soon as it can.
  2151.  
  2152.     Example:
  2153.         LoadBrush "brushes:theimage.grab","arrow"
  2154.         ShowBrush "arrow",50,50
  2155.         Flush "arrow"
  2156.  
  2157.  
  2158. FlushAll
  2159.  
  2160.     This command flushes all Buffers. Buffers that are currently being
  2161. used will be flushed as soon as they can be safely flushed.
  2162.  
  2163.  
  2164. RamScram
  2165.  
  2166.     This causes CanDo to free all Buffer Data that is not being nused and
  2167. has not been modified. Unlike Flushing a buffer, it does not cause CanDo to
  2168. forget the buffer completely. This way the Data can be automatically loaded if
  2169. it is needed again.
  2170.  
  2171.                                      6-63
  2172.  
  2173. InsertChangedBufferList
  2174.  
  2175.     This command TYPE's the name of all modified buffers into the current
  2176. Document (see Document Commands). Each Buffer Name will be on a separate line.
  2177.  
  2178.  
  2179. SaveAllChangedBuffers
  2180.  
  2181.     This causes CanDo to save all buffers that have been modified. If the
  2182. Data was originally loaded from a file, it will be saved using the original
  2183. file specification. Otherwise, it will use the Buffer Name as the file
  2184. specification.
  2185.  
  2186.  
  2187. GetBufferInfo "Buffer Name" , Var1 { , Var2 { , Var3 { , Var4 } } }
  2188.  
  2189.     This command returns information about the specified "Buffer Name".
  2190. This Command only supports the Buffer Type of Picture, Brush, BrushAnim,
  2191. Sound, and Documents. The Var1 through Var4 specifies the variable names that
  2192. should be set to the buffer information. Each of the valid Buffer Types sets
  2193. the variables to a specialized piece of information for the specific Type.
  2194. These are outlined below:
  2195.  
  2196.     Buffer Type    Var1    Var2         Var3     Var4
  2197.     ------------------------------------------------------------------
  2198.     Picture        Width    Height         Depth
  2199.     Brush        Width    Height         Depth
  2200.     BrushAnim    Width    Height         Depth     # of frames
  2201.     Sound        Samples    Seconds         Sample Rate
  2202.     Documents    Lines    Longest Line  Size
  2203.  
  2204.     Examples:
  2205.         GetBufferInfo "Images:Man.pic",PicWidth,PicHeight,
  2206.                   NbrOfBitPlanes
  2207.  
  2208.         GetBufferInfo "Sounds:Howl.snd",Samples,Time,Rate
  2209.  
  2210.                                      6-64
  2211.  
  2212. Functions
  2213.  
  2214.     This Function can be used in expressions to return information
  2215. relating to the Buffer Commands.
  2216.  
  2217.  
  2218. BufferType     "String" = BufferType ( "Buffer Name" )
  2219.  
  2220.     This function returns the BufferType for the specified "Buffer Name".
  2221. The BufferType are: "Brush", "BrushAnim", "Document", "Icon", "Picture","Read
  2222. File", "Write File", and "Sound". If the "Buffer Name" is not found,
  2223. BufferType will return a NULL ("") string.
  2224.  
  2225.  
  2226. System Variables    «logical» = AnyChangedBuffers - TRUE if there are any
  2227.                          modified Buffers.
  2228.  
  2229.                                      6-65
  2230.  
  2231.                                 Misc Commands
  2232.  
  2233.     This last section contains various other commands relating to overall
  2234. control of the Amiga and of your applications.
  2235.  
  2236.  
  2237. Pointer « logical expression »
  2238.  
  2239.     This command turns on or off mouse pointer. When the «logical
  2240. expression» value is TRUE, the image is turned on. When it is False, it is
  2241. turned off.
  2242.  
  2243.  
  2244. SetPointer "Brush Name" [ , < X > , < Y > ]
  2245.  
  2246.     This command allows you to use a DPaint style brush as the mouse
  2247. pointer. It canbe up to 16 pixels wide, and as tall as 127 pixels. If it is
  2248. larger than these dimensions, only the leftmost and topmost part of the image
  2249. will be used. The Optional <X>,<Y> offset specifies the "hotspot" for the
  2250. pointer. Otherwise, it will assume it is located at 0,0.
  2251.     Color Registers 17,18, and 19 are used both for displaying an image
  2252. and for the mouse pointer.
  2253.  
  2254.     Example:
  2255.         SetPointer "Brushes:HandImage.br",5,5
  2256.  
  2257.  
  2258. Dos "DOS Command"
  2259.  
  2260.     The Dos Command executes the string specified in "DOS Command" as an
  2261. AmigaDOS Command. This works as though you typed the command from a CLI
  2262. window.
  2263.  
  2264.     Example:
  2265.         Dos "run c:dir >RAM:Temp.txt"
  2266.  
  2267.  
  2268. SetCurrentDirectory "directory path"
  2269.  
  2270.     This Command sets your applicaton's default directory. This command
  2271. affects file specifications that do not include "device:" portions. It also
  2272. sets the initial default directory for applications invoked using the Dos
  2273. Command. Many applications use this default directory for identifying their
  2274. environment.
  2275.  
  2276.                                      6-66
  2277.  
  2278. Delay < mm > , < ss > , < jj >
  2279.  
  2280.     The Delay Command causes a delay in the execution if the script. The
  2281. values indicate the number of minutes, seconds, and jiffies to delay. The
  2282. script continues to execute after the delay.
  2283.     Note; while a script is being executed, no other object's scripts can
  2284. be processed. This prevents any Buttons, Menus, e.t.c... from executing a
  2285. script. Because the delay cannot be interrupted, an excssively long delay will
  2286. prevent you from exiting a script until the delay has elapsed.
  2287.     The <mm> value indicates the number of minutes, the <ss> indicates
  2288. the number of seconds, and the <jj> indicates the number of jiffies to delay.
  2289. (U.S. Amigas use 1/60 of a second for jiffies, and PAL Amigas use 1/50 of a
  2290. second).
  2291.  
  2292.     Examples:
  2293.         PrintText 50,50,"Taking a 6 second breather."
  2294.         Delay 0,6,0
  2295.  
  2296.         PrintText 50,50,"Taking a One minute break."
  2297.         Delay 1,0,0
  2298.  
  2299.         PrintText 50,50,"Hold for a half a second."
  2300.         Delay 0,0,30
  2301.  
  2302.  
  2303. Echo "Text" { , NOLINE }
  2304.  
  2305.     The Echo Command prints a text message if CanDo or your application
  2306. was starte from a CLI. This can be useful for making CLI application or
  2307. displaying debugging information.
  2308.  
  2309.     Examples:
  2310.         Echo "Print on my CLI Window"
  2311.         Echo "Variable Count = " || Count
  2312.  
  2313.  
  2314. InsertDeviceList LOGICAL PHYSICAL ASSIGNS ALL
  2315.  
  2316.     This command TYPE's the list of Devices into the current Document.
  2317. The keyword LOGICAL returns the logical names of all mounted devices. PHYSICAL
  2318. returns the physical device names (i.e. DF0:, DF1:). ASSIGN returns all system
  2319. assignments. ALL returns all LOGICALS, PHYSICALS, and ASSIGNMENTS.
  2320.  
  2321.     Examples:
  2322.         MakeDocument "System Assignments"
  2323.         InsertDeviceList ASSIGNS
  2324.  
  2325.         MakeDocument "All Devices"
  2326.         InsertDeviceList ALL
  2327.  
  2328.                                      6-67
  2329.  
  2330. InsertDirectoryList { FILEONLY or DIRECTORIESONLY }
  2331.  
  2332.     This command TYPE's the Directory listing for the Current Directory
  2333. (see SetCurrentDirectory). The optional keyword FILESONLY excludes directories
  2334. from the directory listing. DIRECTORIESONLY returns only the sub-directories
  2335. in the Current Directory.
  2336.  
  2337.     Examples:
  2338.         MakeDocument "System Directory"
  2339.         SetCurrentDirectory "SYS:"
  2340.         InsertDirectoryList
  2341.  
  2342.         MakeDocument "Font List"
  2343.         SetCurrentDirectory "Fonts:"
  2344.         InsertDirectoryList DIRECTORIESONLY
  2345.  
  2346.  
  2347. InsertStartingMessage
  2348.  
  2349.     The InsertStartingMessage Command is used to get the parameters used
  2350. for starting an application. If it was started from Workbench using an Icon,
  2351. it will TYPE the full pathnames of all other icons that were selected at the
  2352. time your application was started into the currrent Document. (A user of your
  2353. program could select five icons and then start your program. With this
  2354. command, you would get the names of the five files referred to by those five
  2355. icons). If your application was run from CLI, this command TYPE's each of the
  2356. parameters on the command line. Any parameters enclosed in double-quotes will
  2357. be treated as single parameters. They will have the double-quotes removed and
  2358. internal any doubled double-qoutes ("") will be reduced to single
  2359. double-qoutes.
  2360.     NOTE: When developing your application from CanDo, this command will
  2361. insert the starting message for CanDo. After all, CanDo started your program
  2362. after itself having been started. When running your applications separately,
  2363. however, InsertStartingMessage will insert the starting message to your
  2364. application.
  2365.  
  2366.     «logical» = StartedFromWorkbench - TRUE when started from Workbench.
  2367.  
  2368.      "String" = TheCommandLine       - Returns the command line if
  2369.                         started from CLI, otherwise a NULL
  2370.                         string.
  2371.  
  2372.      "String" = TheCurrentDirectory  - Returns your application's current
  2373.                         directory.
  2374.  
  2375.      "String" = TheOriginDirectory   - This is the directory your program
  2376.                         started running from.
  2377.  
  2378.                                      6-68
  2379.  
  2380.                                   Chapter 7
  2381.  
  2382.                                   Appendices
  2383.  
  2384. Commands Index
  2385.  
  2386. Page            Command
  2387.  
  2388. 6-11 <Integer> =    Absolute ( <value> )
  2389. 6-41 «Logical» =    AnimationStatus
  2390. 6-65 «Logical» =    AnyChangedBuffers
  2391. 6-28        AreaCircle <x>,<y>,<r>
  2392. 6-28        AreaEllipse <x>,<y>,<xr>,<yr>
  2393. 6-28        AreaRectangle <x>,<y>,<w>,<h>
  2394. 6-12 <Integer> =    ASCII ( "string" )
  2395. 6-44        Audio «logical expression»
  2396. 6-17 <Integer> =    AvailableChipMemory
  2397. 6-17 <Integer> =    AvailableFastMemory
  2398. 6-17 <Integer> =    AvailableMemory
  2399. 6-41        BrushAnims «logical»
  2400. 6-65 "String"  =    BufferType ( "Buffer Name" )
  2401. 6-16 "String"  =    BumpRevision ( "Name" )
  2402. 6-17 "String"  =    CardName
  2403. 6-12 "String"  =    Char ( <integer> )
  2404. 6-52 "String"  =    CharsToBegOfLine
  2405. 6-52 "String"  =    CharsToEndOfLine
  2406. 6-49        Clear LINE or DOCUMENT
  2407. 6-31        ClearWindow { <color> }
  2408. 6-26        ClipBrush <x>,<y>,<width>,<height>,"Brush Name" {, CHIP }
  2409. 6-26        ClipPicture "Picture Name" {, CHIP }
  2410. 6-34 <Integer> =    ClipTransparentColor
  2411. 6-54        Close "Buffer Name"
  2412. 6-34 <Integer> =    ColorOfPixel ( <x>,<y> )
  2413. 6-59 "String"  =    CurrentListenTo
  2414. 6-59 "String"  =    CurrentSpeakTo
  2415. 6-32        CycleColors <From-Color>,<To-Color> {, FORWARD or BACKWARD }
  2416. 6-17 "String"  =    DeckName
  2417. 6-57 "String"  =    DefaultTool ( "Icon Name" )
  2418. 6-67        Delay <mm>,<ss>,<jj>
  2419. 6-49        Delete KeyWord {, <count> }
  2420.             KeyWord: TOSTARTOFLINE, TOENDOFLINE, or CHARACTER
  2421. 6-60        DisableObject "Object Name"
  2422. 6-21        Do "routine name" {, Arg1, ..., Arg10 }
  2423.  
  2424.                                      7-1
  2425.  
  2426. 6-52 "String"  =    DocumentName
  2427. 6-66        Dos "DOS Command"
  2428. 6-29        DrawCircle <x>,<y>,<r>
  2429. 6-29        DrawEllipse <x>,<y>,<xr>,<yr>
  2430. 6-29        DrawLine <x1>,<y1>,<x2>,<y2>
  2431. 6-29        DrawPixel <x>,<y>
  2432. 6-30        DrawRectangle <x>,<y>,<w>,<h>
  2433. 6-30        DrawTo <x>,<y>
  2434. 6-13 "String"  =    DupeString ( "String", <count> )
  2435. 6-67        Echo "Text" {, NOLINE }
  2436. 6-60        EnableObject "Object Name"
  2437. 6-16    result =    EvaluateExpression ( "String" )
  2438. 6-20        ExitLoop
  2439. 6-22        ExitScript
  2440. 6-17 «Logical» =    FALSE
  2441. 6-60        FastFeedBack «Logical Expression»
  2442. 6-54        FileReadChars "Buffer Name", VariableName, <NumberOfChars>
  2443. 6-53        FileReadLine "Buffer Name", VariableName
  2444. 6-54        FileWriteChars "Buffer Name", "String" {, <lenght> }
  2445. 6-53        FileWriteLine "Buffer Name", "String"
  2446. 6-29        FillToBorder <x>,<y>,<BorderColor>
  2447. 6-14 <Integer> =    FindChars ( "Source", "Search", <staring offset> )
  2448. 6-15 <Integer> =    FindWord ("Source", "Search Word" {, <StartWordNumber> {,
  2449.             "Worddelimiters" } } )
  2450. 6-23        FirstCard
  2451. 6-28        FloodFill <x>,<y>
  2452. 6-63        Flush "Buffer Name"
  2453. 6-63        FlushAll
  2454. 6-41 <Integer> =    FrameOfAnimation ( "BrushAnim Name" )
  2455. 6-39        GetBrushAnimCoordinates "BrushAnim Name",Xvariable,Yvariable
  2456. 6-64        GetBufferInfo "Buffer Name", Var1 {,Var2 {,Var3 {,Var4 }}}
  2457. 6-15 "String"  =    GetChars ( "Source", <starting offset>, <length> )
  2458. 6-31        GetRGB <col.reg>, RedVar, GreenVar, BlueVar
  2459. 6-34        GetTextDimensions "Text", Width-Variable, Height-Variable
  2460. 6-15 "String"  =    GetWord ( "Source", <WordNumber> {, "WordDelimiters" } )
  2461. 6-23        GotoCard "Card Name"
  2462. 6-37 «Logical» =    Hires
  2463. 6-57 "String"  =    IconType ( "Icon Name" )
  2464. 6-18        If «Logical Expression» ... Else ... EndIf
  2465. 6-64        InsertChangedBufferList
  2466. 6-14 "String"  =    InsertChars ( "Source", "Destionation", <offset> )
  2467. 6-67        InsertDeviceList LOGICAL, PHYSICAL, ASSIGNS, ALL
  2468.  
  2469.                                      7-2
  2470.  
  2471. 6-68        InsertDirectoryList { FILESONLY or DIRECTORIESONLY }
  2472. 6-51        InsertDocument "Document Name"{,<Start Line>{,<LineCount> }}
  2473. 6-59        InsertMessagePortList
  2474. 6-68        InsertStartingMessage
  2475. 6-57        InsertToolTypeList "Icon Name"
  2476. 6-10 <Integer> =    Integer ( Expression )
  2477. 6-61 <Integer> =    IntegerFrom ( "Object Name" )
  2478. 6-37 «Logical» =    InterLace
  2479. 6-17 <Integer> =    LargestChunkOfMemory
  2480. 6-23        LastCard
  2481. 6-52 <Integer> =    LengthOfLine
  2482. 6-05        Let VariableName = Expression
  2483. 6-11 <Integer> =    Limit ( <limit1>, <limit2>, <test value> )
  2484. 6-52 <Integer> =    LinesInDocument
  2485. 6-59        ListenTo "Port Name"
  2486. 6-24        LoadBrush "filename" (, "Name" (, loadflags ) )
  2487. 6-38        LoadBrushAnim "filename" (, "BrushAnim Name" {, loadflags } )
  2488. 6-46        LoadDocument "filename" (, "Document Name" )
  2489. 6-55        LoadIcon "filename" (, "Name" { <loadflags> } )
  2490. 6-24        LoadPicture "filename" (, "Name" {, <loadflags> } )
  2491. 6-42        LoadSound "filename" (, "Sound Name" )
  2492. 6-10 «Logical» =    Logical ( Expression )
  2493. 6-19        Loop ... Until «Logical Expression»
  2494. 6-20        Loop ... EndLoop
  2495. 6-13 "String"  =    LowerCase ( "String" )
  2496. 6-45        MakeDocument "Document Name"
  2497. 6-56        MakeIcon "Icon Name", PROJECT or TOOL, "ImageName" {,
  2498.             "AltImageName"}
  2499. 6-11 <Integer> =    Max ( <val>, <val>, ... )
  2500. 6-17 <Integer> =    MaxInteger
  2501. 6-59 <Integer> =    MessageErrorCode
  2502. 6-59 "String"  =    MessageReturned
  2503. 6-11 <Integer> =    Min ( <val>, <val>, ... )
  2504. 6-17 <Integer> =    MinInteger
  2505. 6-37 <Integer> =    MouseX
  2506. 6-37 <Integer> =    MouseY
  2507. 6-39        MoveBrushAnim "BrushAnim Name", <Xvel>, <Yvel>, { <Xacc>,
  2508.                  <Yacc>, { <ticks> } }
  2509. 6-38        MoveBrushAnimTo "BrushAnim Name", <x>, <y> {, <ticks> }
  2510. 6-47        MoveCursor UP DOWN LEFT or RIGHT {, <Count> }
  2511. 6-48        MoveCursorTo Location Area
  2512.            Location: STARTOF or ENDOF
  2513.            Area    : DOCUMENT,LINE,NEXTWORD,PREVIOUSWORD,or THISWORD
  2514.  
  2515.                                      7-3
  2516.  
  2517. 6-61        MoveObject "Object Name", <x>, <y>
  2518. 6-30        MovePen <x>, <y>
  2519. 6-35        MoveScreen <Delta-X>, <Delta-Y>
  2520. 6-36        MoveWindow <Delta-X>, <Delta-Y>
  2521. 6-47        NewLine
  2522. 6-23        NextCard
  2523. 6-17 «Logical» =    NO
  2524. 6-37 «Logical» =    NTSC
  2525. 6-13 <Integer> =    NumberOfChars ( "String" )
  2526. 6-17 "String"  =    ObjectName
  2527. 6-61 «Logical» =    ObjectState ( "Object Name" )
  2528. 6-17 «Logical» =    OFF
  2529. 6-17 «Logical» =    ON
  2530. 6-53        OpenFile "filename", "Buffer Name", IOFlags, AccessFlags
  2531.            IOFlags    : READONLY or WRITEONLY
  2532.            AccessFlags: NEWFILE, OLDFILE, or APPEND
  2533. 6-34 <Integer> =    PenA
  2534. 6-34 <Integer> =    PenB
  2535. 6-34 <Integer> =    PenO
  2536. 6-42        PlaySound "Sound Name" {, AudioFlags, <period> }
  2537. 6-42        PlaySoundSequence "Document Name" {, AudioFlags, <periode> }
  2538. 6-66        Pointer «Logical Expression»
  2539. 6-16 <Integer> =    PositionOfWord ( "Source",<WordNumber>,{,"WordDelimiters"} )
  2540. 6-48        PositionOnLine <line>
  2541. 6-23        PreviousCard
  2542. 6-33        PrintText <x>, <y>, "String"
  2543. 6-22        Quit
  2544. 6-63        RamScram
  2545. 6-12 <Integer> =    Random ( <Minimum>, <Maximum> )
  2546. 6-30        RayTo <x>, <y>
  2547. 6-39        RemoveBrushAnim "BrushAnim Name"
  2548. 6-14 "String"  =    RemoveChars ( "Source", <starting offset>, <length> )
  2549. 6-51        Replace "fromtext","totext"{,[GLOBAL or ONCE] BYWORD NOCASE}
  2550. 6-64        SaveAllChangedBuffers
  2551. 6-27        SaveBrush "Brush Name" (, "filename" )
  2552. 6-46        SaveDocument "Document Name" (, "filename" )
  2553. 6-55        SaveIcon "Icon Name" (, "filename" )
  2554. 6-27        SavePicture "Picture Name" (, "filename" )
  2555. 6-37 <Integer> =    ScreenColors
  2556.  
  2557.                                      7-4
  2558.  
  2559. 6-37 <Integer> =    ScreenHeight
  2560. 6-35        ScreenTitleBar «Logical Expression»
  2561. 6-35        ScreenTo FRONT or BACK
  2562. 6-37 <Integer> =    ScreenWidth
  2563. 6-37 <Integer> =    ScreenX
  2564. 6-37 <Integer> =    ScreenY
  2565. 6-50        SearchFor "text" {, BYWORD and NOCASE }
  2566. 6-59        SendMessage "MessageText {, NORESULTS }
  2567. 6-31        SetAreaDrawMode NORMAL or OUTLINE
  2568. 6-63        SetAutoLoadFlags [ CHIP and ASNEEDED ] or NONE
  2569. 6-40        SetBrushAnimFlags "BrushAnim Name",<brushanimflags>{,<ticks>}
  2570.            COMPRESSEDMODE or DECOMPRESSEDMODE
  2571.            RESTOREBACKGROUND or LEAVEIMAGE
  2572.            USEMASK or NOMASK
  2573.            SEQUENCEDMOTION or LINEARMOTION
  2574.            FORWARD, BACKWARD and PINGPONG
  2575.            NONE
  2576. 6-44        SetChannel <channel>
  2577. 6-26        SetClipTransparentColor <color>
  2578. 6-66        SetCurrentDirectory "directory path"
  2579. 6-56        SetDefaultTool "Icon Name", "DefaultTool"
  2580. 6-31        SetDrawMode NORMAL JAM1 JAM2 COMPLEMENT INVERSEVIDEO
  2581. 6-54        SetFileBufferSize <sizeinkilos>
  2582. 6-56        SetIconImage "Icon Name", "ImageName" {, "AltImageName" }
  2583. 6-61        SetInteger "Object Name", <value>
  2584. 6-60        SetObjectStart "Object Name", «Logical Expression»
  2585. 6-32        SetPen <penA> {, <penB> {, <penO> } }
  2586. 6-66        SetPointer "Brush Name" {, <x>, <y> }
  2587. 6-33        SetPrintFont "fontname", <pointsize>
  2588. 6-33        SetPrintStyle StandardFlags { ExtendedFlags {, <ExtPen1> {,
  2589.                  <ExtPen2> } } }
  2590.            StandardFlags: PLAIN ITALIC BOLD and UNDERLINED
  2591.            ExtendedFlags: SHADOW OUTLINE GHOSTED or EMBOSSED
  2592. 6-32        SetRGB <col.reg>, <red>, <green>, <blue>
  2593. 6-35        SetScreenTitle "Text"
  2594. 6-61        SetText "Object Name", "Text"
  2595. 6-57        SetToolTypeList "Icon Name", "Document Name"
  2596. 6-44        SetVolume <volume> {, <channel> }
  2597. 6-36        SetWindowLimits <MinX>, <MinY>, <MaxX>, <MaxY>
  2598. 6-36        SetWindowTitle "Text"
  2599. 6-52        SetWordDelimiters "delimiterlist"
  2600. 6-25        ShowBrush "Brush Name", <x>, <y> {, BRUSHPALETTE }
  2601.  
  2602.                                      7-5
  2603.  
  2604. 6-38        ShowBrushAnim "BrushAnim Name", <x>, <y>
  2605. 6-27        ShowPalette "file specification"
  2606. 6-25        ShowPicture "Picture Name"
  2607. 6-12 <Integer> =    Sign ( <value> )
  2608. 6-52 <Integer> =    SizeOfDocument
  2609. 6-58        SpeakTo "PortName"
  2610. 6-47        SplitLine { <count> }
  2611. 6-68 «Logical» =    StartedFromWorkbench
  2612. 6-22        StopScript
  2613. 6-10 "String"  =    String ( Expression )
  2614. 6-17 «Logical» =    Supervised
  2615. 6-61 "String"  =    TextFrom ( "Object Name" )
  2616. 6-52 "String"  =    TheCharacter
  2617. 6-52 <Integer> =    TheColumnNumber
  2618. 6-68 "String"  =    TheCommandLine
  2619. 6-68 "String"  =    TheCurrentDirectory
  2620. 6-17 "String"  =    TheDate
  2621. 6-52 "String"  =    TheLine
  2622. 6-52 <Integer> =    TheLineNumber
  2623. 6-59 "String"  =    TheMessage
  2624. 6-68 "String"  =    TheOriginDirectory
  2625. 6-17 "String"  =    TheTime
  2626. 6-52 "String"  =    TheWord
  2627. 6-52 "String"  =    TheWordDelimiters
  2628. 6-26        Transparent «Logical Expression»
  2629. 6-34 «Logical» =    TransparentStatus
  2630. 6-13 "String"  =    TrimString ( "String" )
  2631. 6-17 «Logical» =    TRUE
  2632. 6-46        Type "String" {, NEWLINE }
  2633. 6-13 "String"  =    UpperCase ( "String" )
  2634. 6-17 «Logical» =    VerifyExpression ( "String" )
  2635. 6-20        While «Logical Expression» ... Until «Logical Expression»
  2636. 6-19        While «Logical Expression» ... EndLoop
  2637. 6-37 <Integer> =    WindowColors
  2638. 6-37 <Integer> =    WindowHeight
  2639. 6-37 "String"  =    WindowTitle
  2640. 6-36        WindowTo FRONT or BACK
  2641. 6-37 <Integer> =    WindowWidth
  2642. 6-37 <Integer> =    WindowX
  2643. 6-37 <Integer> =    WindowY
  2644. 6-46        WorkWithDocument "Document Name"
  2645. 6-17 «Logical» =    YES
  2646.  
  2647.                                      7-6
  2648.  
  2649.                               LoadFlags Appendix
  2650.  
  2651. LoadFlags
  2652.  
  2653.     It is not necessary to use or understand the LoadFlags, However, they
  2654. give you some options on how data is loaded and kept in memory. The LoadFlags
  2655. are KEYWORDs that can be added to the end of any load Command. These Commands
  2656. are: LoadPicture, LoadBrush, LoadSound, LoadBrushAnim, and LoadDocument.
  2657.  
  2658.  
  2659. The LoadFlags are: OVERWRITE CHIP ( DELAYLOAD or ASNEEDED )
  2660.  
  2661.     You do not have to specify any of the loadflags or you can use one or
  2662. more of them. If you use more than one, do not separate them with commas.
  2663.  
  2664.  
  2665. OVERWRITE
  2666.  
  2667.     OVERWRITE causes the file to be re-loaded even if it has alredy been
  2668. loaded into memory. Normally, a load Command will not re-load the file if it
  2669. is currently in memory.
  2670.  
  2671.  
  2672. CHIP
  2673.  
  2674.     CHIP causes the file to be loaded into the Amiga's CHIP memory.
  2675. Loading a file into CHIP memory causes an image to be displayed slightly
  2676. faster. However, CHIP memory is a valuable resource. The CHIP loadflag is only
  2677. relevant when used with the LoadPicture and LoadBrush Command.
  2678.  
  2679.  
  2680. DELAYLOAD or ASNEEDED
  2681.  
  2682.     DELAYLOAD or ASNEEDED are used to alter when the file is loaded. By
  2683. default, a file is loaded if it is not already in memory. You can specify
  2684. either DELAYLOAD or ASNEEDED, but not both.
  2685.  
  2686.  
  2687. DELAYLOAD
  2688.  
  2689.     DELAYLOAD indicates not to load the until a Show or Play Command is
  2690. used. Also, using the DELAYLOAD flag allows you to specify a "Name" other than
  2691. the "filename" and still have it automatically loaded. When a Show Command
  2692. uses "Name", it will load the "filename" specified in the Load Command.
  2693.  
  2694.  
  2695. ASNEEDED
  2696.  
  2697.     ASNEEDED does the same thing as DELAYLOAD except it automatically
  2698. flushes the loaded file from memory when it is not being used. Normally, the
  2699. file remains in memory until it is flushed with a Flush Command or a memory
  2700. panic occurs. A memory panic occurs when there is not enough memory to
  2701. complete an operation. When this happens, CanDo automatically flushes ALL data
  2702. not being used. Even so, running out of memory is a dangerous condition.
  2703. ASNEEDED is very useful when there is not a lot of memory and a delay is
  2704. acceptable each time the file is used.
  2705.  
  2706.     Examples:
  2707.         LoadPicture "Images:Background.pic", "Background", DELAYLOAD
  2708.  
  2709.         LoadPicture "Images:Background.pic", "Background", CHIP
  2710.  
  2711.         LoadPicture "Images:Background.pic", "Background", ASNEEDED CHIP
  2712.  
  2713.         LoadPicture "Images:Background.pic", "Background", OVERWRITE
  2714.  
  2715.                                      7-7
  2716.  
  2717.                               Advanced Features
  2718.  
  2719.     CanDo has many features that you may customize to suit your tastes.
  2720. These may be changed by editing the ToolTypes in CanDo's icon. Do this by
  2721. selecting the CanDo icon and then selecting Info in the Workbench menu. Edit
  2722. each ToolType and press Return. An alternate method of setting CanDo's
  2723. defaults is to create a text file named CanDo.defaults and save it to your S:
  2724. directory. This file should contain the same text as was contained in the
  2725. ToolTypes, one ToolType per line. Here are the ToolTypes and an explanaion of
  2726. each. If the ToolType is not defined, it will default to the value shown in
  2727. brackets ([]).
  2728.  
  2729. EDITORTOOLS = "Path" ["EditorTools"]
  2730.  
  2731.     The name of the directory where the EditorTool files reside.
  2732.  
  2733. XTRAS = "Path" ["XtraTools"]
  2734.  
  2735.     The name of the directory where the Xtra Object files reside.
  2736.  
  2737. OBJECTS = "Path" ["ObjectTools"]
  2738.  
  2739.     The name of the directory where the Object files reside.
  2740.  
  2741. HELPFILES = "Path" ["CanDoExtras:HelpFiles"]
  2742.  
  2743.     The name of the directory where the Help files reside.
  2744.  
  2745. SOUNDS = "Path" ["CanDoExtras:Sounds"]
  2746.  
  2747.     This is the default directory in which CanDo looks for your sounds.
  2748.  
  2749. IMAGES = "Path" ["CanDoExtras:Images"]
  2750.  
  2751.     This is the default directory in which CanDo looks for your images.
  2752.  
  2753. BRUSHES = "Path" ["CanDoExtras:Brushes"]
  2754.  
  2755.     The default directory in which CanDo looks for your brushes or
  2756.     clipped graphics.
  2757.  
  2758. BRUSHANIMS = "Path" ["CanDoExtras:BrushAnims"]
  2759.  
  2760.     The default directory in which CanDo looks for your DPaintIII
  2761.     BrushAnims.
  2762.  
  2763. DOCUMENTS = "Path" ["CanDoExtras:Documents"]
  2764.  
  2765.     The default directory in which CanDo looks for your text documents.
  2766.  
  2767. DECKS = "Path" ["CanDoExtras:Decks"]
  2768.  
  2769.     The default directory for saving and loading your decks.
  2770.  
  2771. DEFAULTDECK = "PathFile"
  2772.  
  2773.     You may set the Deck to be loaded when CanDo is started or when you
  2774.     select New from CanDo's Deck Menu.
  2775.  
  2776.                                      7-8
  2777.  
  2778. SOUNDEFFECTS = On or Off [On]
  2779.  
  2780.     This turns all CanDo's sound effects On or Off.
  2781.  
  2782. SOUNDVOLUME = 0 to 64 [64]
  2783.  
  2784.     This is the volume setting for CanDo's sound effects. It can range
  2785.     from 0 (quiet) to 64 (loud).
  2786.  
  2787. SCROLLSPEED = 1 to 10 [5]
  2788.  
  2789.     This controls how fast CanDo's screen scrolls up and down. It can be
  2790.     a value of 1 to 10 where 1 is the fastest.
  2791.  
  2792. INHERITWINDOW = On or Off [On]
  2793.  
  2794.     When CanDo makes a new card it inherits the current card's window
  2795.     (On) or it uses the default window (Off).
  2796.  
  2797. COORDINATEDRAG = On or Off [Off]
  2798.  
  2799.     When making a box (button, field, etc...) to define an object, this
  2800.     flag controls the method of interaction:
  2801.         On  = Position, Click, Drag, Release
  2802.         Off = Position, Click, Release, Move, Click, Release.
  2803.  
  2804. CANDOFONT = "fontname" ["topaz"]
  2805.  
  2806.     This defines the font to be used by CanDo. This font must have an
  2807. eight point non-proportional render.
  2808.  
  2809. AUTOREQUESTERS = On or Off [On]
  2810.  
  2811.     This can be used to turn Off (skip showing) intermediate requesters.
  2812.  
  2813. CRASHFILE = "PathFile" ["CanDoExtras:Decks/CanDo.CrashDeck"]
  2814.  
  2815.     If CanDo crashes, it can store the current Deck to a file. This must
  2816.     be a valid path and filename. If the name is a Null ("") then CanDo
  2817.     does not store the current Deck.
  2818.  
  2819. ICONS = On or Off [On]
  2820.  
  2821.     This informs CanDo whether or not to create an icon for Decks that
  2822.     are saved.
  2823.  
  2824. ICONDEFAULTTOOL = "Default Tool" ["C:CanDoRunner"]
  2825.  
  2826.     When CanDo creates an icon for a Deck, this is the default tool for
  2827.     the icon. Normally, this should be CanDo.runtime, which is the small
  2828.     runtime module that uses the CanDo.Library in your LIBS: directory.
  2829.     To make a distributable application be sure to use the CanDoBinder.
  2830.  
  2831.     Remember to look on your CanDo and CanDoExtras disk for the ReadMe
  2832. files. These files contain last minute information that was not included in
  2833. this manual.
  2834.     There are many subtl, and not so subtl, methods of easily doing
  2835. seemingly complex operations in CanDo's scripting language. Please look
  2836. through the example Decks that are included on your CanDoExtras disk. These
  2837. Decks have many different scripts that are good examples of scripting. The
  2838. best way of learning the ins and outs is to experiment and try new things.
  2839.  
  2840.                                      7-9
  2841.  
  2842.                                 Error Messages
  2843.  
  2844.                                 Syntax Errors
  2845.  
  2846. Unknown Command
  2847.  
  2848.     This first word on the line is not a valid Command. You probably
  2849. misspelled the Comand or you forgot to type LET for an assignment.
  2850.  
  2851. Too many parameters
  2852.  
  2853.     The Command line has too many parameters. It's also possible you
  2854. provided a parameter for a Command that does not use any.
  2855.  
  2856. Not enought parameters
  2857.  
  2858.     The Command needs more parameters than you provided.
  2859.  
  2860. Unrecognized KEYWORD
  2861.  
  2862.     You provided an urecognized word where a KEYWORD was expected. It is
  2863. possible you tried to use a variable name in its place.
  2864.  
  2865. Conflicting switches specified
  2866.  
  2867.     You indicated two or more KEYWORDs that cannot be used together.
  2868.  
  2869. Too many IF's
  2870.  
  2871.     You have too many IF/ENDIF combinations in your script.
  2872.  
  2873. IF without matching ENDIF
  2874.  
  2875.     You do not have an ENDIF for every IF Command in your script.
  2876.  
  2877. Unexpected ELSE or ENDIF
  2878.  
  2879.     You don't have an IF before every ELSE or ENDIF Command.
  2880.  
  2881. LOOP/WHILE without matching ENDLOOP/UNTIL
  2882.  
  2883.     Your script does not have an ENDLOOP or UNTIL for every LOOP or WHILE
  2884. Command in your script.
  2885.  
  2886. Unexpected EXITLOOP/ENDLOOP/UNTIL
  2887.  
  2888.     You don't have a LOOP or WHILE before every EXITLOOP, ENDLOOP, or
  2889. UNTIL Command.
  2890.  
  2891. Too many LOOP's
  2892.  
  2893.     You have too nany LOOP/WHILE ... ENDLOOP/UNTIL combinations in your
  2894. script.
  2895.  
  2896. Misplaced operator
  2897.  
  2898.     An expression contains a misplaced operator. An operator was found in
  2899. a place where a variable or constant was wxpected.
  2900.  
  2901. Mismatched parenthesis
  2902.  
  2903.     An expression does not have matching parenthesis.
  2904.  
  2905. Expression is too complicated
  2906.  
  2907.     An expression has too many parenthesis and operations. Simplify the
  2908. expression be removing a portion of it and assigning it to a variable. You can
  2909. then use the variable in place of this portion.
  2910.  
  2911. Invalid expression
  2912.  
  2913.     CanDo could not figure out an expression.
  2914.  
  2915.                                      7-10
  2916.  
  2917.                                 Runtime Errors
  2918.  
  2919. Named routine not found
  2920.  
  2921.     A Do Command attempted to run a routine that does not exist.
  2922.  
  2923. Card not found
  2924.  
  2925.     A GotoCard Command attempted to go to a card that does not exist.
  2926.  
  2927. Named Object not found
  2928.  
  2929.     An Object Command referenced an Object that does not exist.
  2930.  
  2931. Named Object is wrong type
  2932.  
  2933.     the referenced Object can not be used in this context.
  2934.  
  2935. Addressed port not found
  2936.  
  2937.     The ARexx port specified in an ListenTo Command does not exist.
  2938.  
  2939. Named buffer not found
  2940.  
  2941.     The "Buffer Name" specified in a Buffer Command does not exist.
  2942.  
  2943. Named buffer is wrong type
  2944.  
  2945.     The "Buffer Name" can not be used in this context.
  2946.  
  2947. Stack overflow
  2948.  
  2949.     You have too many nested Do Commands. This probably is because a
  2950. Routine is calling itself indefinitely.
  2951.  
  2952. Command not allowed in current mode
  2953.  
  2954.     This Command cannot be used from within CanDo but it can be used when
  2955. your project is running by itself. The System Variable SUPERVISED is true when
  2956. your project is running from CanDo.
  2957.  
  2958. No Document selected
  2959.  
  2960.     You attempted to use a Document Command without first making a
  2961. Document.
  2962.  
  2963. Name evaluated to a NULL string
  2964.  
  2965.     A string evaluated to a NULL ("") when a valid name was required.
  2966.  
  2967. Division by ZERO
  2968.  
  2969.     An expression contained a division by ZERO (0).
  2970.  
  2971. Invalid variable name
  2972.  
  2973.     The Command contained an invalid variable name, or an attempt to set
  2974. the value of a System Variable or Function. The Command required a variable
  2975. name.
  2976.  
  2977.                                      7-11
  2978.  
  2979. Screen open error
  2980.  
  2981.     Not enough chip memory was available in your Amiga to open a screen
  2982. the size that is required by your card's window.
  2983.  
  2984. Window open error
  2985.  
  2986.     Not enought chip memory was available in your Amiga to open your
  2987. card's window.
  2988.  
  2989. Unknown IFF FORM type
  2990.  
  2991.     The IFF file referenced is not of a type CanDo knows how to deal
  2992. with. Alternately, it might be a corrupt IFF file.
  2993.  
  2994. Brush file has no mask stored with it
  2995.  
  2996.     The brush file was saved in a format that does not have a mask, and
  2997. one cannot be computed. The mask is used for Image buttons and ShowBrush with
  2998. Transparent enabled.
  2999.  
  3000. Permature EOF
  3001.  
  3002.     A file referenced in your script, or used by one of your Objects, was
  3003. not complete.
  3004.  
  3005. Not enough memory
  3006.  
  3007.     Not enough memory was available in your Amiga to perform the current
  3008. operation. CanDo will first try to release any memory is not using at the
  3009. moment before resorting to this error.
  3010.  
  3011.                                      7-12
  3012.  
  3013.                                  File Errors
  3014.  
  3015. Object in use
  3016.  
  3017.     A file (or device) that your script refeenced is in use bu another
  3018. program in your Amiga. Your program must wait until that DOS object is free.
  3019.  
  3020. Directory not found
  3021.  
  3022.     Your script tried to run a SetCurrentDirectory Command into a
  3023. directory that could not be found. Check your script for accuracy.
  3024.  
  3025. Object not found
  3026.  
  3027.     A file (or device) could not be located using the name as it appeared
  3028. in your script. Check the filename for accuracy and correct it.
  3029.  
  3030. Wrong file type
  3031.  
  3032.     A file that you tried to load (probably as an IFF file) is not of the
  3033. currect type.
  3034.  
  3035. Disk not validated
  3036.  
  3037.     Your script tried to write to a disk or volume that has not been
  3038. validated by AmigaDOS.
  3039.  
  3040. Disk write-protected
  3041.  
  3042.     Your script tried to write to a disk that has been write-protected.
  3043.  
  3044. Device not mounted
  3045.  
  3046.     A file was referenced on a volume that could not be found.
  3047.  
  3048. Disk full
  3049.  
  3050.     The disk that your script was writing to has become full. Often, this
  3051. can be corrected without interrupting your script by deleting unneeded files
  3052. from the full disk.
  3053.  
  3054. File delete-protected
  3055.  
  3056.     Your script attempted to save a buffer on top of a file already on
  3057. the disk that has been protected from deletion.
  3058.  
  3059. File write-protected
  3060.  
  3061.     Your script opened a WriteFile buffer using a file that is
  3062. write-protected.
  3063.  
  3064. Not DOS disk
  3065.  
  3066.     A disk in your system, referenced by your script, is not a standard
  3067. AmigaDOS disk. Disks of this sort cannot be used with CanDo.
  3068.  
  3069.                                      7-13
  3070.  
  3071.                                T H E   E N D 
  3072.